public ActionResult Create(City city) { if (ModelState.IsValid) { city.CityId = Guid.NewGuid(); db.Cities.Add(city); db.SaveChanges(); return RedirectToAction("Index"); } return View(city); }
public ActionResult Edit(City city) { if (ModelState.IsValid) { db.Entry(city).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(city); }