public ActionResult Edit(Doctor doctor) { if (ModelState.IsValid) { db.Entry(doctor).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(doctor); }
public ActionResult Create(Doctor doctor) { if (ModelState.IsValid) { db.Doctor.Add(doctor); db.SaveChanges(); return RedirectToAction("Index"); } return View(doctor); }