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())); }
public async Task <IActionResult> Index() { TempData["active"] = "topic"; return(View(await _topicApiService.GetAllAsync())); }