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