You are using an anonymous delegate with the same signature as Func<int, bool>
right now. If you wanted to use a method instead, you could write:
// a method that takes int and returns bool is
// a Func<int, bool> delegate
public bool IsEqualTo21(int x)
{
return (x == 21);
}
And then use it as:
var twentyoneCount = numbers.Where(IsEqualTo21).Count();
Groo
2009-10-12 07:32:13