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