Пример #1
0
 public QueryOptionResult(QueryOption query, IQueryable <T> datas)
 {
     this.Keyword   = query.Keyword;
     this.Page      = query.Page;
     this.SortField = query.SortField;
     this.SortOrder = query.SortOrder;
     this.Datas     = datas.GetCurrentPage(query);
     this.PageCount = datas.GetPageCount(query);
 }
Пример #2
0
 public static IQueryable <TSource> GetCurrentPage <TSource>(this IQueryable <TSource> source, QueryOption queryOption) =>
 source.OrderBy(queryOption.GetSortString())
 .GetCurrentPage(queryOption.Page, queryOption.GetPageSize());
Пример #3
0
 public static int GetPageCount <TSource>(this IQueryable <TSource> source, QueryOption queryOption) =>
 source.GetPageCount(queryOption.GetPageSize());