public ResultListFilter(PageCriteria paging, SortCriteria sorting) { Guard.Begin().IsNotNull(paging, nameof(paging)).IsNotNull(sorting, nameof(sorting)).Check(); Paging = paging; Sorting = sorting; }
public static IQueryable <T> PagedAndSorted <T>(this IQueryable <T> query, PageCriteria paging, SortCriteria sort) { //simply sort and page return(query.OrderBy(sort).Paged(paging)); }
public static IQueryable <T> Paged <T>(this IQueryable <T> query, PageCriteria paging) { return(query.Skip(paging.StartIndex).Take(paging.Size)); }
public static IQueryable <T> Paged <T>(this IQueryable <T> query, PageCriteria paging, out int total) { total = query.Count(); //grab count of total before paging return(query.Paged(paging)); }
public static IQueryable <T> PagedAndSorted <T>(this IQueryable <T> query, PageCriteria paging, SortCriteria sort, out int total) { return(query.OrderBy(sort).Paged(paging, out total)); }