score:3

Accepted answer

try this:

func<myobject, bool> datepredicate = (o => o.date > datetime.now.adddays(-1));

collection.where(datepredicate);

also when you're doing .singleordefault(), not sure how that will magically turn into a type since your list<t> is not a list<type> as far as i know (since type doesn't have a date property).

score:0

the compiler cannot statically figure out what type your o parameter is. i would presume o is of type datetime. compilers don't make presumptions :)

predicate<datetime> datepredicate = o => o.date > datetime.now.adddays(-1);

try that.


Related Query

More Query from same tag