public virtual async Task <PaginatedList <T> > GetPagedData(int page = 1, int pageSize = 25, Func <IQueryable <T>, IOrderedQueryable <T> > orderedQuery = null, Expression <Func <T, bool> > filter = null, params Expression <Func <T, object> >[] includes) { var pagedList = await PaginatedList <T> .GetPaged(_dbContext.Set <T>(), page, pageSize, orderedQuery, filter, includes); return(pagedList); }
// Method to implement Server side pagination using skip() and take() methods that will transalate to // SQL Server offset and fetch next public async Task <PaginatedList <T> > GetPagedData(int pageIndex, int pageSize, Func <IQueryable <T>, IOrderedQueryable <T> > orderedQuery = null, Expression <Func <T, bool> > filter = null) { var pagedList = await PaginatedList <T> .GetPaged(_dbContext.Set <T>(), pageIndex, pageSize, orderedQuery, filter); return(pagedList); }