public ActionResult Edit(int id, Aluno aluno) { try { if (ModelState.IsValid) { uow.GetRepository<Aluno>().Update(aluno); uow.Save(); } } catch (Exception exc) { return View("CustomError", exc); } return RedirectToAction("Create"); }
public ActionResult Delete(int id, Aluno aluno) { try { uow.GetRepository<Aluno>().DeleteById(id); uow.Save(); return RedirectToAction("Create"); } catch (Exception exc) { return View("CustomError", exc); } }