public ActionResult Edit(Review review) { if (ModelState.IsValid) { db.Entry(review).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.TouristAttractionId = new SelectList(db.TouristAttractions, "TouristAttractionId", "Name", review.TouristAttractionId); return View(review); }
public ActionResult Create(Review review) { if (ModelState.IsValid) { db.Reviews.Add(review); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.TouristAttractionId = new SelectList(db.TouristAttractions, "TouristAttractionId", "Name", review.TouristAttractionId); return View(review); }