public ActionResult Edit(Pet pet) { if (ModelState.IsValid) { db.Entry(pet).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(pet)); }
public ActionResult Edit(Visit visit) { if (ModelState.IsValid) { db.Entry(visit).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.PetId = new SelectList(db.Pets, "Id", "Name", visit.PetId); return(View(visit)); }