public ActionResult Create(Doctor doctor) { if (ModelState.IsValid) { _db.Doctors.Add(doctor); _db.SaveChanges(); return RedirectToAction("IndexList"); } return View(doctor); }
public ActionResult Edit(Doctor doctor) { if (ModelState.IsValid) { _db.Entry(doctor).State = EntityState.Modified; Doctor doc= _db.Doctors.Find(doctor.DoctorId); doc = doctor; _db.SaveChanges(); return RedirectToAction("IndexList"); } return View(doctor); }