How can I combine two lambda expressions into one using an OR ?
I have tried the following but merging them requires me to pass parameters into the Expressio
Sound interesting ... I don't know much about lambda expression, but I found this article. Under PredicateBuilder Source Code is an example for or that works for me:
public static Expression> Or(
this Expression> expr1,
Expression> expr2 )
{
var invExpr = Expression.Invoke( expr2, expr1.Parameters.Cast() );
return Expression.Lambda>
( Expression.OrElse( expr1.Body, invExpr ), expr1.Parameters );
}