Пример #1
0
 public ActionResult Create(Curso curso)
 {
     try
     {
         if (ModelState.IsValid)
         {
             _cursoRepositorio.InserirCurso(curso);
             _cursoRepositorio.Salvar();
             return(RedirectToAction("Index"));
         }
     }
     catch (DataException)
     {
         ModelState.AddModelError("", "Não foi possível salvar as mudanças. Tente novamente....");
     }
     return(View(curso));
 }