コード例 #1
0
 public ActionResult Edit(MovieReviews review)
 {
     if (ModelState.IsValid)
     {
         _db.Entry(review).State = EntityState.Modified;
         _db.SaveChanges();
         return RedirectToAction("Index", new { id = review.MovieId });
     }
     return View();
 }
コード例 #2
0
 public ActionResult Create(MovieReviews _review)
 {
     if (ModelState.IsValid)
     {
         _db.MovieReviews.Add(_review);
         _db.SaveChanges();
         return RedirectToAction("Index", new { id = _review.MovieId });
     }
     return View(_review);
 }