How to Combine two lambdas

Viewed 9592

Possible Duplicate:
combining two lamba expressions in c#

I have two following expressions:

Expression<Func<string, bool>> expr1 = s => s.Length == 5;
Expression<Func<string, bool>> expr2 = s => s == "someString";

Now I need to combine them with OR. Something like this:

Expression.Or(expr1, expr2)

Is there any way to make this similar to above code way like:

expr1 || expr2

I understand in this example I can just combine it in the first place:

Expression<Func<string, bool>> expr = s => s.Length == 5 || s == "someString"

but I can't do it in my real code as I get expr1 and expr2 as arguments to the method.

2 Answers
Related