I am using an interface I found, which has a method that takes a LINQ expression as a parameter.
How would I implement this method to use the LINQ Expression? I can see it being very useful, but dont how to write the code to use it!!
Its a repository interface.
signature is…
IQueryable<T> Get(Expression<Func<T, bool>> criteria);
Sounds like you are looking for something like this:
This passes your expression
criteriato the linq-method Where. You can then call it like this:Of course, this is pretty stupid; it would be better to just implement
IEnumerable<T>…