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