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