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