//IEnumerable<int> source = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }
bool NumberIsEven(int value)
{
return value % 2 == 0;
}
IEnumerable<int> result = source.Filter(NumberIsEven);
//result = { 2, 4, 6, 8, 10 }
//IEnumerable<int> source = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }
IEnumerable<int> result =
source.Filter(value => value % 2 == 1);
//result = { 1, 3, 5, 7, 9 }