public int GetPagesCount() { LibraryManagementSystemContext context = new LibraryManagementSystemContext(); RolesRepository rolesRepository = new RolesRepository(context); int pagesCount = 0; int rolesCount = rolesRepository.Count(); int itemsPerPage = ApplicationConfiguration.ItemsPerPage; pagesCount = rolesCount / itemsPerPage; if ((rolesCount % itemsPerPage) > 0) { pagesCount++; } return(pagesCount); }
public int GetPagesCount() { LibraryManagementSystemContext context = new LibraryManagementSystemContext(); RolesRepository rolesRepository = new RolesRepository(context); int pagesCount = 0; int rolesCount = rolesRepository.Count(); int itemsPerPage = ApplicationConfiguration.ItemsPerPage; pagesCount = rolesCount / itemsPerPage; if ((rolesCount % itemsPerPage) > 0) { pagesCount++; } return pagesCount; }