Exemplo n.º 1
0
 public static SelectExpression RemoveOrderExpression(this SelectExpression select, OrderExpression ordering)
 {
     if (select.OrderBy != null && select.OrderBy.Count > 0)
     {
         var orderby = new List <OrderExpression>(select.OrderBy);
         orderby.Remove(ordering);
         return(select.SetOrderBy(orderby));
     }
     return(select);
 }
Exemplo n.º 2
0
        public static SelectExpression AddOrderExpression(this SelectExpression select, OrderExpression ordering)
        {
            var orderby = new List <OrderExpression>();

            if (select.OrderBy != null)
            {
                orderby.AddRange(select.OrderBy);
            }
            orderby.Add(ordering);
            return(select.SetOrderBy(orderby));
        }