Ejemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "MovieId,Title,Description,Rating,ReleaseDate")] Movie movie)
 {
     if (ModelState.IsValid)
     {
         db.Entry(movie).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(movie));
 }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "ActorId,Name,Surname,DateofBirth")] Actor actor)
 {
     if (ModelState.IsValid)
     {
         db.Entry(actor).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(actor));
 }
Ejemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "MovieId,ActorId")] MovieActor movieActor)
 {
     if (ModelState.IsValid)
     {
         db.Entry(movieActor).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ActorId = new SelectList(db.Actors, "ActorId", "Name", movieActor.ActorId);
     ViewBag.MovieId = new SelectList(db.Movies, "MovieId", "Title", movieActor.MovieId);
     return(View(movieActor));
 }