Пример #1
0
 public ActionResult Edit([Bind(Include = "AlbumID,Title")] Album album)
 {
     if (ModelState.IsValid)
     {
         db.Entry(album).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(album);
 }
Пример #2
0
 public ActionResult Edit([Bind(Include = "ReviewID,AlbumID,Contents,ReviewEmail")] Review review)
 {
     if (ModelState.IsValid)
     {
         db.Entry(review).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AlbumID = new SelectList(db.Albums, "AlbumID", "Title", review.AlbumID);
     return(View(review));
 }