public async Task <IActionResult> Details(int id) { if (id <= 0) { return(RedirectToAction(nameof(Index))); } var catdetail = await _categoryViewModelService.GetCategoryAsync(id); if (catdetail == null) { return(RedirectToAction(nameof(Index))); } return(View(catdetail)); }