Esempio n. 1
0
        public async Task <IActionResult> Index(int?categoryId, string s)
        {
            if (categoryId.HasValue)
            {
                ViewBag.ActiveCategory = categoryId;
                return(View(await _topicApiService.GetAllByCategoryIdAsync((int)categoryId)));
            }
            if (!string.IsNullOrWhiteSpace(s))
            {
                ViewBag.SearchString = s;
                return(View(await _topicApiService.Search(s)));
            }

            return(View(await _topicApiService.GetAllAsync()));
        }
Esempio n. 2
0
 public async Task <IActionResult> Index()
 {
     TempData["active"] = "topic";
     return(View(await _topicApiService.GetAllAsync()));
 }