public override DbExpression Visit(DbApplyExpression expression)
        {
            EntityUtil.CheckArgumentNull(expression, "expression");

            DbExpression result = expression;

            DbExpressionBinding newInput = this.VisitExpressionBindingEnterScope(expression.Input);
            DbExpressionBinding newApply = this.VisitExpressionBinding(expression.Apply);

            this.ExitScope();

            if (!object.ReferenceEquals(expression.Input, newInput) ||
                !object.ReferenceEquals(expression.Apply, newApply))
            {
                if (DbExpressionKind.CrossApply == expression.ExpressionKind)
                {
                    result = CqtBuilder.CrossApply(newInput, newApply);
                }
                else
                {
                    Debug.Assert(expression.ExpressionKind == DbExpressionKind.OuterApply, "DbApplyExpression had ExpressionKind other than CrossApply or OuterApply?");
                    result = CqtBuilder.OuterApply(newInput, newApply);
                }
            }
            NotifyIfChanged(expression, result);
            return(result);
        }
        /// <summary>
        /// Visitor pattern method for <see cref="DbApplyExpression"/>.
        /// </summary>
        /// <param name="expression">The DbApplyExpression that is being visited.</param>
        /// <exception cref="ArgumentNullException"><paramref name="expression"/> is null</exception>
        public override void Visit(DbApplyExpression expression)
        {
            // #433613: PreSharp warning 56506: Parameter 'expression' to this public method must be validated: A null-dereference can occur here.
            EntityUtil.CheckArgumentNull(expression, "expression");

            VisitExpressionBindingPre(expression.Input);

            // #433613: PreSharp warning 56506: Parameter 'expression.Apply' to this public method must be validated: A null-dereference can occur here.
            if (expression.Apply != null)
            {
                VisitExpression(expression.Apply.Expression);
            }

            VisitExpressionBindingPost(expression.Input);
        }
 /// <summary>
 /// Typed visitor pattern method for DbApplyExpression.
 /// </summary>
 /// <param name="expression">The DbApplyExpression that is being visited.</param>
 /// <returns>An instance of TResultType.</returns>
 public abstract TResultType Visit(DbApplyExpression expression);
Esempio n. 4
0
 /// <summary>
 /// Visitor pattern method for DbApplyExpression.
 /// </summary>
 /// <param name="expression">The DbApplyExpression that is being visited.</param>
 public abstract void Visit(DbApplyExpression expression);