Inheritance: SqlExpression
Ejemplo n.º 1
0
 protected override SqlExpression VisitJoin(JoinExpression expr)
 {
     SqlExpression left = this.VisitSource(expr.Left);
     IList<OrderByDeclaration> leftOrders = this.gatheredOrderings;
     this.gatheredOrderings = null;
     SqlExpression right = this.VisitSource(expr.Right);
     this.PrependOrderings(leftOrders);
     SqlExpression condition = this.Visit(expr.Condition);
     return base.UpdateJoin(expr, expr.JoinType, left, right, condition);
 }
Ejemplo n.º 2
0
 protected override SqlExpression VisitJoin(JoinExpression expr)
 {
     this.VisitSource(expr.Left);
     this.NewLine(Indentation.Same);
     switch(expr.JoinType)
     {
         case JoinType.CrossJoin:
             this.Write("CROSS JOIN ");
             break;
         case JoinType.InnerJoin:
             this.Write("INNER JOIN ");
             break;
         case JoinType.CrossApply:
             this.Write("CROSS APPLY ");
             break;
         case JoinType.OuterApply:
             this.Write("OUTER APPLY ");
             break;
         case JoinType.LeftOuterJoin:
             this.Write("LEFT OUTER JOIN ");
             break;
     }
     this.VisitSource(expr.Right);
     if(expr.Condition != null)
     {
         this.NewLine(Indentation.Same);
         this.Write("ON ");
         this.Visit(expr.Condition);
     }
     return expr;
 }