示例#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);
 }
 public static IQueryable <TSource> GetCurrentPage <TSource>(this IQueryable <TSource> source, QueryOption queryOption) =>
 source.OrderBy(queryOption.GetSortString())
 .GetCurrentPage(queryOption.Page, queryOption.GetPageSize());
 public static int GetPageCount <TSource>(this IQueryable <TSource> source, QueryOption queryOption) =>
 source.GetPageCount(queryOption.GetPageSize());