예제 #1
0
 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);
 }
예제 #2
0
 public ActionResult Create(RestarauntReview review)
 {
     if (ModelState.IsValid)
     {
         _db.Reviews.Add(review);
         _db.SaveChanges();
         return RedirectToAction("Index", new { id = review.RestarauntId });
     }
     return View();
 }