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