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