Esempio n. 1
0
 public void TopConstructorTest()
 {
     Expression expression = Sql.Integer(10);
     TopFlags flags = TopFlags.Percent;
     Top target = new Top(expression, flags);
     Assert.IsNotNull(target);
     Assert.IsNotNull(target.Expression);
     Assert.IsTrue(target.Expression is ConstantTypes.Integer);
     Assert.IsTrue(((ConstantTypes.Integer)target.Expression).Value == 10);
     Assert.IsTrue((target.Flags & TopFlags.Percent) == TopFlags.Percent);
 }
Esempio n. 2
0
 public Select.Select Select(Top top, params Column[] selectedItems)
 {
     var expressions = new List<Expression>();
     foreach (var c in selectedItems)
     {
         expressions.Add(c);
     }
     return new Select.Select(top, expressions, From, this);
 }
Esempio n. 3
0
 public ScalarSelect ScalarSelect(Top top, Scalar selectedItem)
 {
     return new Select.ScalarSelect(top, selectedItem, From, this);
 }
Esempio n. 4
0
 private void GenerateExpressionSelectTop(Top expression, TextWriter writer, CodeGeneratorOptions options)
 {
     writer.Write("TOP (");
     GenerateCodeFromExpression(expression.Expression, writer, options);
     writer.Write(")");
     writer.Write((expression.Flags & TopFlags.Percent) == TopFlags.Percent ? " PERCENT" : string.Empty);
     writer.Write((expression.Flags & TopFlags.WithTies) == TopFlags.WithTies ? " WITH TIES" : string.Empty);
 }
Esempio n. 5
0
 public Select.Select Select(Top top, List<Expression> selectList, GroupBy.GroupBy groupBy, OrderBy.OrderBy orderBy)
 {
     return new Select.Select(top, selectList, From, this, groupBy, orderBy);
 }
Esempio n. 6
0
 public Select.Select Select(Top top, List<Expression> selectList, Where.Where where, GroupBy.GroupBy groupBy)
 {
     return new Select.Select(top, selectList, this, where, groupBy);
 }
Esempio n. 7
0
 public ScalarSelect(Top top, Expression selectItem, From.From from, Where.Where where)
     : base(null)
 {
     _select = new Select(null, selectItem, from, where);
 }
Esempio n. 8
0
 public Select(Top top, Expression selectItem, From.From from, Where.Where where)
     : this(selectItem, from, where)
 {
     SelectTop = top;
 }
Esempio n. 9
0
 public Select(Top top, List<Expression> selectList, From.From from, Where.Where where)
     : this(selectList, from, where)
 {
     SelectTop = top;
 }
Esempio n. 10
0
 public Select(Top top, List<Expression> selectList)
     : this(top)
 {
     SelectList = selectList;
 }
Esempio n. 11
0
 public Select(Top top, List<Expression> selectedItems, Where.Where where)
     : this(top, selectedItems)
 {
     Where = where;
 }
Esempio n. 12
0
 public Select(Top top, Expression selectItem, From.From from, Where.Where where, GroupBy.GroupBy groupBy, OrderBy.OrderBy orderBy)
     : this(top, selectItem, from, where, groupBy)
 {
     OrderBy = orderBy;
 }
Esempio n. 13
0
 public Select(Top top)
 {
     SelectTop = top;
 }
Esempio n. 14
0
 public Select(Top top, List<Expression> selectList, From.From from, Where.Where where, GroupBy.GroupBy groupBy, OrderBy.OrderBy orderBy)
     : this(top, selectList, from, where, groupBy)
 {
     OrderBy = orderBy;
 }
Esempio n. 15
0
 public Select.Select Select(Top top, Expression selectItem, Where.Where where)
 {
     return new Select.Select(top, selectItem, this, where);
 }
Esempio n. 16
0
 public Select(Top top, List<Expression> selectList, From.From from, Where.Where where, GroupBy.GroupBy groupBy)
     : this(top, selectList, from, where)
 {
     GroupBy = groupBy;
 }
Esempio n. 17
0
 public Select.Select Select(Top top, List<Expression> selectList, Where.Where where)
 {
     return new Select.Select(top, selectList, this, where);
 }
Esempio n. 18
0
 public Select(Top top, Expression selectItem, From.From from, Where.Where where, GroupBy.GroupBy groupBy)
     : this(top, selectItem, from, where)
 {
     GroupBy = groupBy;
 }
Esempio n. 19
0
 public Select.Select Select(Top top, Expression selectItem, Where.Where where, GroupBy.GroupBy groupBy)
 {
     return new Select.Select(top, selectItem, this, where, groupBy);
 }
Esempio n. 20
0
 public Select(Top top, OrderBy.OrderBy orderBy)
     : this(top)
 {
     OrderBy = orderBy;
 }
Esempio n. 21
0
 public ScalarSelect(Top top, Expression selectItem, From.From from, Where.Where where, GroupBy.GroupBy groupBy, OrderBy.OrderBy orderBy)
     : base(null)
 {
     _select = new Select(top, selectItem, from, where, groupBy, orderBy);
 }
Esempio n. 22
0
 public Select(Top top, Expression selectItem, From.From from, OrderBy.OrderBy orderBy)
     : this(top, selectItem, from, null, orderBy)
 {
     //
 }
Esempio n. 23
0
 public Select.Select Select(Top top, List<Expression> selectList)
 {
     return new Select.Select(top, selectList, From, this);
 }
Esempio n. 24
0
 public Select.Select Select(Top top, List<Expression> selectedItems)
 {
     return new Select.Select(top, selectedItems, From, Where, this);
 }
Esempio n. 25
0
 public Select.Select Select(Top top, Expression selectItem, GroupBy.GroupBy groupBy, OrderBy.OrderBy orderBy)
 {
     return new Select.Select(top, selectItem, From, this, groupBy, orderBy);
 }
Esempio n. 26
0
 public Select.Select Select(Top top, Expression selectItem)
 {
     return new Select.Select(top, selectItem, From, Where, this);
 }
Esempio n. 27
0
 public ScalarSelect ScalarSelect(Top top, Expression selectItem)
 {
     return new ScalarSelect(top, selectItem, From, this);
 }
Esempio n. 28
0
 public ScalarSelect SubQuery(Top top, Expression selectItem)
 {
     return new ScalarSelect(top, selectItem, From, Where, this);
 }
Esempio n. 29
0
 public Select.Select Select(Top top)
 {
     return new Select.Select(top);
 }
Esempio n. 30
0
 public void TopConstructorTest4()
 {
     int count = 10; // TODO: Initialize to an appropriate value
     Top target = new Top(count);
     Assert.IsNotNull(target);
     Assert.IsNotNull(target.Expression);
     Assert.IsTrue(((ConstantTypes.Integer)target.Expression).Value == 10);
 }