public ActionResult Edit(RestarauntReview review) { if (ModelState.IsValid) { _db.Entry(review).State = EntityState.Modified; //this is not new, so dont insert, only update existing _db.SaveChanges(); return RedirectToAction("Index", new { id = review.RestarauntId }); } return View(review); }
public ActionResult Create(RestarauntReview review) { if (ModelState.IsValid) { _db.Reviews.Add(review); _db.SaveChanges(); return RedirectToAction("Index", new { id = review.RestarauntId }); } return View(); }