public ActionResult Create(Medical medical) { if (ModelState.IsValid) { medical.id = Guid.NewGuid(); db.Medicals.Add(medical); db.SaveChanges(); return RedirectToAction("Index"); } return View(medical); }
public ActionResult Edit(Medical medical) { if (ModelState.IsValid) { db.Entry(medical).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(medical); }