예제 #1
0
        public ActionResult Create(Ville ville)
        {
            if (ModelState.IsValid)
            {
                db.VilleSet.Add(ville);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(ville);
        }
예제 #2
0
 public ActionResult Edit(Ville ville)
 {
     if (ModelState.IsValid)
     {
         db.Entry(ville).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(ville);
 }