public static string GetOrderingColumn(this Ordering ordering) { if (ordering.IsDescending()) { return(ordering.column.Substring(1)); } return(ordering.column); }
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); }