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