Friday, February 27, 2009

Sometimes it's the simple things

Sometimes the solution is so obvious:

Func<Document, bool> predicate = a => a.FileDate >start_date && a.FileDate <end_date;

BuildAndAddRows(table, predicate);

//inside the function

var query = (from d in this.DocumentList orderby d.VehicleName select d).Where(predicate).Select(a => new { a.VehicleName, a.VehicleID });

No comments:

Post a Comment