Ejemplo n.º 1
0
        public ActionResult DeleteFamily(int id)
        {
            _service.Delete(id);

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