public static Expression Replace(Expression searchedExpression, Expression expressionToReplace, Expression replacementExpression) { var visitor = new FindAndReplaceVisitor(expressionToReplace, replacementExpression); return visitor.Visit(searchedExpression); }
public static Expression Replace(Expression searchedExpression, Expression expressionToReplace, Expression replacementExpression) { var visitor = new FindAndReplaceVisitor(expressionToReplace, replacementExpression); return(visitor.Visit(searchedExpression)); }
public Expression CreateGetterExpression(Expression instance) { var formula = this.GetPropertyFormula(); if (formula == null) { return(Expression.MakeMemberAccess(instance, NormalizedPropertyInfo)); } //// TODO: Make some assertions here.. return(FindAndReplaceVisitor.Replace(formula.Body, formula.Parameters[0], instance)); }