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:
Do you mean something like this:
public void UseLambda (IEnumerable source , Func where, Func order)
{
if(source != null)
{
IOrderedEnumerable orderBy = source.Where(where).OrderBy(order);
foreach (T value in orderBy)
{
Console.WriteLine(value);
}
}
}
So that you could call it like so:
UseLambda(numbers, x => x > 6, x => x % 2 == 0);