I have two expression trees of type : Expression<Func<string, bool>>
and I would like to obtain a single Expression that will do the OR of the two expressions (passing the same string parameter to both expressions)
Any idea?
I have two expression trees of type : Expression<Func<string, bool>>
and I would like to obtain a single Expression that will do the OR of the two expressions (passing the same string parameter to both expressions)
Any idea?
You can use PredicateBuilder
from LINQKit to do this. For example:
Expression<Func<string, bool>> e1 = …;
Expression<Func<string, bool>> e2 = …;
Expression<Func<string, bool>> combined = e1.Or(e2).Expand();