public ActionResult Delete(AlunoModel model) { try { _servicoDeAluno.Excluir(model.Id); return RedirectToAction("Index"); } catch { return View(model); } }
public ActionResult Edit(AlunoModel model) { try { var aluno = Mapper.Map<Aluno>(model); _servicoDeAluno.Alterar(aluno); return RedirectToAction("Index"); } catch { return View(model); } }
public ActionResult Create(AlunoModel model) { try { var aluno = Mapper.Map<Aluno>(model); _servicoDeAluno.Adicionar(aluno); return RedirectToAction("Index"); } catch { return View(); } }