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