Exemple #1
0
        public int GetPagesCount(Expression <Func <Publisher, bool> > filter = null)
        {
            LibraryManagementSystemContext context = new LibraryManagementSystemContext();
            PublishersRepository           publishersRepository = new PublishersRepository(context);

            int pagesCount      = 0;
            int pageSize        = ApplicationConfiguration.ItemsPerPage;
            int publishersCount = 0;

            publishersCount = publishersRepository.Count(filter);
            pagesCount      = publishersCount / pageSize;
            if ((publishersCount % pageSize) > 0)
            {
                pagesCount++;
            }

            return(pagesCount);
        }
        public int GetPagesCount(Expression<Func<Publisher, bool>> filter = null)
        {
            LibraryManagementSystemContext context = new LibraryManagementSystemContext();
            PublishersRepository publishersRepository = new PublishersRepository(context);

            int pagesCount = 0;
            int pageSize = ApplicationConfiguration.ItemsPerPage;
            int publishersCount = 0;
            publishersCount = publishersRepository.Count(filter);
            pagesCount = publishersCount / pageSize;
            if ((publishersCount % pageSize) > 0)
            {
                pagesCount++;
            }

            return pagesCount;
        }