public static Expression EvaluateIndependentSubtrees(Expression expression)
        {
            var partialEvaluationInfo = NhEvaluatableTreeFindingExpressionVisitor.Analyze(expression, ExpressionFilter);
            var visitor             = new NhPartialEvaluatingExpressionVisitor(partialEvaluationInfo);
            var evaluatedExpression = visitor.Visit(expression);

            return(evaluatedExpression);
        }
Пример #2
0
        public new static PartialEvaluationInfo Analyze(Expression expressionTree, IEvaluatableExpressionFilter evaluatableExpressionFilter)
        {
            if (expressionTree == null)
            {
                throw new ArgumentNullException(nameof(expressionTree));
            }
            if (evaluatableExpressionFilter == null)
            {
                throw new ArgumentNullException(nameof(evaluatableExpressionFilter));
            }

            var visitor = new NhEvaluatableTreeFindingExpressionVisitor(evaluatableExpressionFilter);

            visitor.Visit(expressionTree);

            return(visitor.PartialEvaluationInfo);
        }