Exemplo n.º 1
0
        public ActionResult <IAsyncEnumerable <SuggestionPaggingListVM> > Index(string sortOrder = "newest", string searchString = "", int pageNumber = 1, Guid?categoryId = null)
        {
            ViewData["CurrentSort"]   = sortOrder;
            ViewData["CurrentFilter"] = searchString;
            ViewData["PageNumber"]    = pageNumber;
            ViewData["Category"]      = categoryId;

            var suggestions = _suggestionService.GetList(false, searchString, sortOrder, pageNumber, 5, categoryId);

            suggestions.Pagging.ActionName     = "Index";
            suggestions.Pagging.ControllerName = "Home";

            ToolbarVM toolbarVM = new ToolbarVM();

            toolbarVM.ControllerName = "Home";
            toolbarVM.ActionName     = "Index";
            toolbarVM.ShowSearch     = true;
            toolbarVM.Categories     = _categoryService.GetSelectList();

            suggestions.ToolbarData = toolbarVM;

            return(View(suggestions));
        }