public async Task <IActionResult> CreateCategory(CategoryDetailViewModel model) { if (ModelState.IsValid) { var category = await _newsService.CreateCategoryAsync(model.Category); ShowAlertSuccess($"Added Category \"{category.Name}\"!"); return(RedirectToAction(nameof(Categories))); } model.Action = nameof(CreateCategory); return(View("CategoryDetail", model)); }