public PaginatedList(IQueryable <T> allItems, int pageIndex, int itemsPerPage) { CoreValidator.ThrowIfNotPositive(itemsPerPage); this.TotalPages = this.CalculateTotalPages(allItems, itemsPerPage); this.PageIndex = this.GetValidPageIndex(pageIndex); this.data = this.GetPaginatedData(allItems, pageIndex, itemsPerPage); }