Ejemplo n.º 1
0
        public IActionResult NewsList(string categories, int page = 1)
        {
            const int         pageSize          = 10;
            NewsListViewModel newsListViewModel = new NewsListViewModel()
            {
                pageInfo = new PageInfoNews()
                {
                    TotalItems      = _newsServices.GetCountByCategory(categories),
                    CurrentPage     = page,
                    ItemsPerPage    = pageSize,
                    CurrentCategory = categories
                },
                News = _newsServices.GetNewsByCategory(categories, page, pageSize)
            };

            return(View(newsListViewModel));
        }