I found the following example which works well:
private static bool GreaterTwo(int arg)
{
return arg > 2;
}
public static void GreaterTwoSample()
{
Enumerable.Range(0, 10).Where(GreaterTwo);
}
What would be the syntax for using GreaterTwo with another parameter within the WHERE-Lambda:
private static bool GreaterTwoSmallerArg2(int arg, int arg2)
{
return arg > 2 && arg < arg2;
}
UPDATE: thanks to HugoRune's answer, here is another working example with 2 parameters
public static void LimitationSample()
{
Enumerable.Range(0, 10).Where(IsBetween(2, 5));
}
private static Func<int, bool> IsBetween(int min, int max)
{
return x => x > min && x < max;
}