public ActionResult DeleteFamily(int id)
        {
            _service.Delete(id);

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