Exemplo n.º 1
0
 public ActionResult Edit(Restaurant restaurant)
 {
     if (ModelState.IsValid)
     {
         _db.Update(restaurant);
         _db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(restaurant));
 }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,Name,City,Country")] Restaurant restaurant)
 {
     if (ModelState.IsValid)
     {
         _db.Update(restaurant);
         _db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(restaurant));
 }