示例#1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="select"></param>
 /// <param name="ordering"></param>
 /// <returns></returns>
 public static SelectExpression RemoveOrderExpression(this SelectExpression select, OrderExpression ordering)
 {
     if (select.OrderBy != null && select.OrderBy.Count > 0)
     {
         List <OrderExpression> orderby = new List <OrderExpression>(select.OrderBy);
         orderby.Remove(ordering);
         return(select.SetOrderBy(orderby));
     }
     return(select);
 }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="select"></param>
        /// <param name="ordering"></param>
        /// <returns></returns>
        public static SelectExpression AddOrderExpression(this SelectExpression select, OrderExpression ordering)
        {
            List <OrderExpression> orderby = new List <OrderExpression>();

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