public void DoPagination(GroupResults groupResults, int currentPageNumber, int pageSize) { if ((groupResults != null) && groupResults.Groups.Any()) { var paginatedGroups = PaginationHelper.GetPaginatedItemsForSpecifiedPage( groupResults.Groups, currentPageNumber, "groups", pageSize, _configuration.GetGroupsDefaultPageSize("stockportgov")); groupResults.Groups = paginatedGroups.Items; groupResults.Pagination = paginatedGroups.Pagination; groupResults.Pagination.CurrentUrl = groupResults.CurrentUrl; } else { groupResults.Pagination = new Pagination(); } }