I am trying to write a static function to Or two expressions, but recieve the following error:
The parameter \'item\' is not in scope.
Descrip
As already suggested, here you can find this very nice (working) code
public static Expression> Or(this Expression> expr1, Expression> expr2)
{
var invokedExpr = Expression.Invoke(expr2, expr1.Parameters.Cast());
return Expression.Lambda>(Expression.Or(expr1.Body, invokedExpr), expr1.Parameters);
}
that you can adapt to your needs and which isn't tied (IMHO) to LINQ.