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)); }
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)); }