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