public ActionResult Delete(int id = 0) { CategoryEntity model = new CategoryEntity { Id = id }; try { categorySrv.Delete(model); } catch { ModelState.AddModelError("", "Во время удаления произошли ошибки!"); } return(RedirectToAction("Index")); }
public ActionResult Delete(int id = 0) { CountryEntity model = new CountryEntity() { Id = id }; if (ModelState.IsValid) { try { countrySrv.Delete(model); return(RedirectToAction("Index")); } catch { ModelState.AddModelError("", "Во время удаления произошли ошибки!"); } } return(View(model)); }