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