public virtual OrderByExpression Combine(OrderByExpression other)
        {
            if (other == null)
            {
                return(this);
            }

            var result = this;

            foreach (var orderByExpression in other.Iterate().Reverse())
            {
                result = new ThenOrderByExpression(result, orderByExpression.Expression, orderByExpression.Descending);
            }

            return(result);
        }
예제 #2
0
 private SelectExpression(
     ProjectionExpression projection,
     TableExpression table,
     Expression predicate,
     OrderByExpression orderBy,
     Expression offset,
     Expression limit,
     bool isDistinct,
     Expression grouping,
     bool isWindowed)
 {
     Projection = projection ?? throw new ArgumentNullException(nameof(projection));
     Table      = table;
     Predicate  = predicate;
     OrderBy    = orderBy;
     Offset     = offset;
     Limit      = limit;
     IsDistinct = isDistinct;
     Grouping   = grouping;
     IsWindowed = isWindowed;
 }
 public ThenOrderByExpression(OrderByExpression previous, Expression expression, bool descending)
     : base(expression, descending)
 {
     Previous = previous ?? throw new ArgumentNullException(nameof(previous));
 }
예제 #4
0
 public SqlWindowFunctionExpression(SqlFunctionExpression function, OrderByExpression ordering)
 {
     Function = function ?? throw new ArgumentNullException(nameof(function));
     Ordering = ordering ?? throw new ArgumentNullException(nameof(ordering));
 }
예제 #5
0
 public SelectExpression UpdateOrderBy(OrderByExpression orderBy)
 {
     return(new SelectExpression(Projection, Table, Predicate, orderBy, Offset, Limit, IsDistinct, Grouping, IsWindowed));
 }