Пример #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);
 }
Пример #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);
 }
Пример #3
0
 public ScalarSelect ScalarSelect(Top top, Scalar selectedItem)
 {
     return new Select.ScalarSelect(top, selectedItem, From, this);
 }
Пример #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);
 }
Пример #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);
 }
Пример #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);
 }
Пример #7
0
 public ScalarSelect(Top top, Expression selectItem, From.From from, Where.Where where)
     : base(null)
 {
     _select = new Select(null, selectItem, from, where);
 }
Пример #8
0
 public Select(Top top, Expression selectItem, From.From from, Where.Where where)
     : this(selectItem, from, where)
 {
     SelectTop = top;
 }
Пример #9
0
 public Select(Top top, List<Expression> selectList, From.From from, Where.Where where)
     : this(selectList, from, where)
 {
     SelectTop = top;
 }
Пример #10
0
 public Select(Top top, List<Expression> selectList)
     : this(top)
 {
     SelectList = selectList;
 }
Пример #11
0
 public Select(Top top, List<Expression> selectedItems, Where.Where where)
     : this(top, selectedItems)
 {
     Where = where;
 }
Пример #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;
 }
Пример #13
0
 public Select(Top top)
 {
     SelectTop = top;
 }
Пример #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;
 }
Пример #15
0
 public Select.Select Select(Top top, Expression selectItem, Where.Where where)
 {
     return new Select.Select(top, selectItem, this, where);
 }
Пример #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;
 }
Пример #17
0
 public Select.Select Select(Top top, List<Expression> selectList, Where.Where where)
 {
     return new Select.Select(top, selectList, this, where);
 }
Пример #18
0
 public Select(Top top, Expression selectItem, From.From from, Where.Where where, GroupBy.GroupBy groupBy)
     : this(top, selectItem, from, where)
 {
     GroupBy = groupBy;
 }
Пример #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);
 }
Пример #20
0
 public Select(Top top, OrderBy.OrderBy orderBy)
     : this(top)
 {
     OrderBy = orderBy;
 }
Пример #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);
 }
Пример #22
0
 public Select(Top top, Expression selectItem, From.From from, OrderBy.OrderBy orderBy)
     : this(top, selectItem, from, null, orderBy)
 {
     //
 }
Пример #23
0
 public Select.Select Select(Top top, List<Expression> selectList)
 {
     return new Select.Select(top, selectList, From, this);
 }
Пример #24
0
 public Select.Select Select(Top top, List<Expression> selectedItems)
 {
     return new Select.Select(top, selectedItems, From, Where, this);
 }
Пример #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);
 }
Пример #26
0
 public Select.Select Select(Top top, Expression selectItem)
 {
     return new Select.Select(top, selectItem, From, Where, this);
 }
Пример #27
0
 public ScalarSelect ScalarSelect(Top top, Expression selectItem)
 {
     return new ScalarSelect(top, selectItem, From, this);
 }
Пример #28
0
 public ScalarSelect SubQuery(Top top, Expression selectItem)
 {
     return new ScalarSelect(top, selectItem, From, Where, this);
 }
Пример #29
0
 public Select.Select Select(Top top)
 {
     return new Select.Select(top);
 }
Пример #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);
 }