public virtual TOutput VisitMultiary(MultiaryExpression expression, TContext context)
        {
            TOutput result = default;

            for (var i = 0; i < expression.Expressions.Count; i++)
            {
                var     operand       = expression.Expressions[i];
                TOutput currentResult = operand.AcceptVisitor(this, context);
                if (i == 0)
                {
                    result = currentResult;
                }
                else
                {
                    result = _outputAggregator(result, currentResult);
                }
            }

            return(result);
        }
Пример #2
0
        public virtual Expression VisitMultiary(MultiaryExpression expression, TContext context)
        {
            IReadOnlyList <Expression> rewrittenExpressions = VisitArray(expression.Expressions, context);

            return(ReferenceEquals(rewrittenExpressions, expression.Expressions) ? expression : new MultiaryExpression(expression.MultiaryOperation, rewrittenExpressions));
        }