Combining two expressions (Expression<Func<T, bool>>)
Asked 07 September, 2021
Viewed 2.1K times
  • 58
Votes

I have two expressions of type Expression<Func<T, bool>> and I want to take to OR, AND or NOT of these and get a new expression of the same type

Expression<Func<T, bool>> expr1;
Expression<Func<T, bool>> expr2;

...

//how to do this (the code below will obviously not work)
Expression<Func<T, bool>> andExpression = expr AND expr2

8 Answer