예제 #1
0
 public ActionResult Edit(Review review)
 {
     if (ModelState.IsValid)
     {
         db.Entry(review).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(review);
 }
예제 #2
0
        public ActionResult Create(Review review)
        {
            if (ModelState.IsValid)
            {
                db.Reviews.Add(review);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(review);
        }