I understand that you can do the following:
enumerable.Where(MethodGroup).DoSomething();
and this is achieved by the same:
enumerable.Where(x => MyMethod(x)).DoSomething();
However, I want to achieve this and select the elements where the method returns false. Obviously, how to do this for the second case:
enumerable.Where(x => !MyMethod(x)).DoSomething();
However, for the first, this is not the case, since you cannot apply the operator !to MethodGroup. Is it possible to achieve such an effect " .WhereNot" using the MethodGroupssame way, or do I need to roll my own (or use lambda)?
source
share