예제 #1
0
        public ViewResult All(int page = 1, String category = null, String searchText = null)
        {
            ArticlesSummariesViewModel model = new ArticlesSummariesViewModel(category, searchText);

            List <Article> articles = articleRepository.GetAllArticles(category: category, searchText: searchText);

            model.PaginationModel = PaginationService.GetDefaultPaginationModel(articles, page);
            articles = PaginationService.Paginate(articles, page).ToList();

            model.Articles = articles;

            return(View(model));
        }