public ActionResult Edit(Person person) { if (ModelState.IsValid) { context.Entry(person).State = EntityState.Modified; context.SaveChanges(); return RedirectToAction("Index"); } return View(person); }
public ActionResult Create(Person person) { if (ModelState.IsValid) { context.People.Add(person); context.SaveChanges(); return RedirectToAction("Index"); } return View(person); }