Esempio n. 1
0
 public ActionResult Delete(int id)
 {
     try
     {
         Estudante estudante = _estudanteRepositorio.GetEstudantePorID(id);
         _estudanteRepositorio.DeletarEstudante(id);
         _estudanteRepositorio.Salvar();
     }
     catch (DataException)
     {
         return(RedirectToAction("Delete",
                                 new RouteValueDictionary {
             { "id", id },
             { "saveChangesError", true }
         }));
     }
     return(RedirectToAction("Index"));
 }