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