示例#1
0
 public static string GetOrderingColumn(this Ordering ordering)
 {
     if (ordering.IsDescending())
     {
         return(ordering.column.Substring(1));
     }
     return(ordering.column);
 }
示例#2
0
 public static IQueryable SetOrderQuery <T>(this Ordering ordering, IQueryable <T> query)
 {
     if (ordering.IsOrdering())
     {
         var order = ordering.GetOrderingColumn();
         return(query.OrderBy(order, ordering.IsDescending()));
     }
     return(query);
 }