public ActionResult Delete(int id, Patient patient) { try { db.Entry(patient).State = EntityState.Deleted; db.SaveChanges(); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult Create(Patient patient) { try { db.Patients.Add(patient); db.SaveChanges(); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult Edit(int id, Patient patient) { try { db.Entry(patient).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } catch { throw; return View(); } }