Exemplo n.º 1
0
 private static PagedListData <T> GetPagedListData(SQLPagedList <T> pagelist)
 {
     return(new PagedListData <T>()
     {
         Data = pagelist,
         MetaData = new PagedListMeta()
         {
             HasNextPage = pagelist.HasNextPage,
             HasPreviousPage = pagelist.HasPreviousPage,
             Skip = pagelist.PageIndex,
             Take = pagelist.PageSize,
             TotalCount = pagelist.TotalCount,
             TotalPages = pagelist.TotalPages,
         }
     });
 }
Exemplo n.º 2
0
        public static PagedListData <T> Create(IQueryable <T> source, int pageIndex, int pageSize)
        {
            var pagelist = new SQLPagedList <T>(source, pageIndex, pageSize);

            return(GetPagedListData(pagelist));
        }
Exemplo n.º 3
0
        public static PagedListData <T> Create(IEnumerable <T> source, int pageIndex, int pageSize, int totalCount, bool isPaged = false)
        {
            var pagelist = new SQLPagedList <T>(source, pageIndex, pageSize, totalCount, isPaged);

            return(GetPagedListData(pagelist));
        }