public static ReplaceParameters ( |
||
@in | ||
Результат |
private static Expression <Func <T, bool> > Combine <T>(Expression <Func <T, bool> > head, IEnumerable <Expression <Func <T, bool> > > tail, Func <Expression, Expression, BinaryExpression> combiner) { var result = tail.Aggregate(head, (soFar, element) => { var lambda = LambdaSubstituter.ReplaceParameters(element, soFar.Parameters); return((Expression <Func <T, bool> >)Expression.Lambda(combiner(soFar.Body, lambda), soFar.Parameters)); }); return(result); }
protected override Expression VisitMethodCall(MethodCallExpression node) { if (AreTheSameMethod(node.Method, _what.Method)) { if (IsTheSameObject(node.Object, _what.Object)) { return(LambdaSubstituter.ReplaceParameters(_with, node.Arguments)); } } return(base.VisitMethodCall(node)); }
public static Expression Splice(this LambdaExpression e, params Expression[] newExpr) { return(LambdaSubstituter.ReplaceParameters(e, newExpr)); }
public static Expression Splice(this LambdaExpression e, IEnumerable <Expression> newExpr) { return(LambdaSubstituter.ReplaceParameters(e, newExpr)); }