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