public ActionResult DeleteFamily(int id) { _service.Delete(id); if (ModelState.IsValid) { return(NotFound()); } else { return(BadRequest(ModelState)); } }
public ActionResult Delete(int id) { try { FamilyService.Delete(id); } catch (NotFoundException) { return(HttpNotFound()); } catch (HasRelationsException) { return(Content("Удаление невозможно.")); } return(RedirectToAction("Index")); }