public ActionResult Excluir(int id) { TipoSaude tipoSaude = db.TipoSaude.Find(id); db.TipoSaude.Remove(tipoSaude); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Editar(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } TipoSaude tipoSaude = db.TipoSaude.Find(id); if (tipoSaude == null) { return(HttpNotFound()); } var tipoSaudeVM = Mapper.Map <TipoSaude, TipoSaudeViewModel>(tipoSaude); return(View(tipoSaudeVM)); }