EvaluateIndependentSubtrees() public static method

public static EvaluateIndependentSubtrees ( Expression expressionTree ) : Expression
expressionTree System.Linq.Expressions.Expression
return System.Linq.Expressions.Expression
コード例 #1
0
        public override Expression VisitExpression(Expression expression)
        {
            if (expression == null)
            {
                return(null);
            }
            if (expression.NodeType == ExpressionType.Lambda ||
                !this._partialEvaluationInfo.IsEvaluatableExpression(expression))
            {
                return(base.VisitExpression(expression));
            }
            Expression expressionTree = this.EvaluateSubtree(expression);

            if (expressionTree != expression)
            {
                return(CustomPartialEvaluatingExpressionTreeVisitor.EvaluateIndependentSubtrees(expressionTree));
            }
            else
            {
                return(expressionTree);
            }
        }
コード例 #2
0
 public Expression Process(Expression expressionTree)
 {
     ArgumentUtility.CheckNotNull <Expression>("expressionTree", expressionTree);
     return(CustomPartialEvaluatingExpressionTreeVisitor.EvaluateIndependentSubtrees(expressionTree));
 }