public ActionResult Edit(RestaurantReview review) { if (ModelState.IsValid) { _db.Entry(review).State = EntityState.Modified; _db.SaveChanges(); return RedirectToAction("Index", new { id = review.RestaurantId }); } return View(review); }
public ActionResult Create(RestaurantReview review) { if(ModelState.IsValid) { _db.Reviews.Add(review); _db.SaveChanges(); return RedirectToAction("Index", new { id = review.RestaurantId }); } return View(review); }