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