Inheritance: System.Linq.Expressions.ExpressionVisitor
コード例 #1
0
 public static Expression Replace(Expression searchedExpression,
                                  Expression expressionToReplace,
                                  Expression replacementExpression)
 {
     var visitor = new FindAndReplaceVisitor(expressionToReplace, replacementExpression);
     return visitor.Visit(searchedExpression);
 }
コード例 #2
0
        public static Expression Replace(Expression searchedExpression,
                                         Expression expressionToReplace,
                                         Expression replacementExpression)
        {
            var visitor = new FindAndReplaceVisitor(expressionToReplace, replacementExpression);

            return(visitor.Visit(searchedExpression));
        }
コード例 #3
0
ファイル: PropertySpec.cs プロジェクト: anthrax3/Pomona
        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));
        }