You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 line
384B

  1. using HealthMonitor.Util.QueryObjects;
  2. namespace HealthMonitor.Core.Query.Extensions
  3. {
  4. public static class PagerExt
  5. {
  6. public static IQueryable<T> Pager<T>(this IQueryable<T> query, Paging paging)
  7. {
  8. paging.TotalCount = query.Count();
  9. return query.Skip((paging.CurPage - 1) * paging.PageSize).Take(paging.PageSize);
  10. }
  11. }
  12. }