I need to pass the lambda query as a parameter, the followings code is sample and I am interesting to find an implement for it, there is samples: some thing like this:
If you define your LINQ expressions like this:
Func, IEnumerable> expr1 =
l => l.Where(n => n > 6).OrderBy(n => n % 2 == 0).Select(n => n);
Func, IEnumerable> expr2 =
l => l.TakeWhile((n, index) => n >= index);
And your UseLambda method as:
public void UseLambda (IEnumerable source
,Func, IEnumerable> lambda)
{
var items= lambda(source);
foreach(var item in items)
Console.Writeline(item.ToString());
}
}
Then you I think you have what you're looking for.