public ActionResult DeleteCategory(int categoryId) { Category category = businessLayer.DeleteCategory(categoryId); if (category != null) { TempData["message"] = string.Format("{0} was successfully deleted", category.Name); } return(RedirectToAction("GetCategories", "Admin")); }