public override DbExpression Visit(DbJoinExpression expression) { EntityUtil.CheckArgumentNull(expression, "expression"); DbExpression result = expression; DbExpressionBinding newLeft = this.VisitExpressionBinding(expression.Left); DbExpressionBinding newRight = this.VisitExpressionBinding(expression.Right); this.EnterScope(newLeft.Variable, newRight.Variable); DbExpression newCondition = this.VisitExpression(expression.JoinCondition); this.ExitScope(); if (!object.ReferenceEquals(expression.Left, newLeft) || !object.ReferenceEquals(expression.Right, newRight) || !object.ReferenceEquals(expression.JoinCondition, newCondition)) { if (DbExpressionKind.InnerJoin == expression.ExpressionKind) { result = CqtBuilder.InnerJoin(newLeft, newRight, newCondition); } else if (DbExpressionKind.LeftOuterJoin == expression.ExpressionKind) { result = CqtBuilder.LeftOuterJoin(newLeft, newRight, newCondition); } else { Debug.Assert(expression.ExpressionKind == DbExpressionKind.FullOuterJoin, "DbJoinExpression had ExpressionKind other than InnerJoin, LeftOuterJoin or FullOuterJoin?"); result = CqtBuilder.FullOuterJoin(newLeft, newRight, newCondition); } } NotifyIfChanged(expression, result); return(result); }
/// <summary> /// Visitor pattern method for <see cref="DbJoinExpression"/>. /// </summary> /// <param name="expression">The DbJoinExpression that is being visited.</param> /// <exception cref="ArgumentNullException"><paramref name="expression"/> is null</exception> public override void Visit(DbJoinExpression 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.Left); VisitExpressionBindingPre(expression.Right); VisitExpression(expression.JoinCondition); VisitExpressionBindingPost(expression.Left); VisitExpressionBindingPost(expression.Right); }
/// <summary> /// Typed visitor pattern method for DbJoinExpression. /// </summary> /// <param name="expression">The DbJoinExpression that is being visited.</param> /// <returns>An instance of TResultType.</returns> public abstract TResultType Visit(DbJoinExpression expression);
/// <summary> /// Visitor pattern method for DbJoinExpression. /// </summary> /// <param name="expression">The DbJoinExpression that is being visited.</param> public abstract void Visit(DbJoinExpression expression);