Пример #1
0
        private PagedList(IQueryable <T> query, DataTablesOptions paginationData)
        {
            TotalCount = query.Count();
            PageNumber = (int)Math.Ceiling(paginationData.Start / (double)paginationData.Length) + 1;
            PageSize   = paginationData.Length;
            PagesCount = (int)Math.Ceiling(TotalCount / (double)PageSize);

            AddRange(query.Skip(paginationData.Start).Take(PageSize).ToList());
        }
Пример #2
0
 public static PagedList <T> Create(IQueryable <T> source, DataTablesOptions paginationData)
 {
     return(new PagedList <T>(source, paginationData));
 }