Given the following
Expression<Func<T,bool>> matchExpression;
How can i create another expression that is a ‘not’ of the existing one.
i have tried
Expression<Func<T, bool>> func3 = (i) => !matchExpression.Invoke(i);
but this is not supported by the entity framework…
Regards
You have to recreate a new lambda, and negate the body of the original one: