Ejemplo n.º 1
0
        // GET: Articles
        public ActionResult Index([FromQuery] ArticleSearch articleSearch)
        {
            articleSearch.PageNumber = 0;
            var articles = _searchArticlesCommand.Execute(articleSearch);

            return(View(articles.Data));
        }
Ejemplo n.º 2
0
        public IActionResult Index([FromQuery] ArticleSearch articleSearch, CategorySearch categorySearch)
        {
            articleSearch.PageNumber = 0;
            var articles = _searchArticlesCommand.Execute(articleSearch);

            categorySearch.PageNumber = 0;
            var categories = _searchCategoriesCommand.Execute(categorySearch);

            var viewModel = new HomeViewModel
            {
                Articles   = articles.Data,
                Categories = categories.Data
            };

            return(View(viewModel));
        }