public ActionResult Edit([Bind(Include = "id,name,address,phone,email,AvgRating")] Restaurant restaurant)
 {
     if (ModelState.IsValid)
     {
         db.Entry(restaurant).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(restaurant));
 }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "id,name,rating,text,RestID")] Review review)
 {
     if (ModelState.IsValid)
     {
         db.Entry(review).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.RestID = new SelectList(db.Restaurants, "ID", "Name", review.RestID);
     return(View(review));
 }