public ActionResult DeleteConfirmed(int id) { Movie_Actors movie_Actors = db.Movie_Actors.Find(id); db.Movie_Actors.Remove(movie_Actors); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Actor_Id,Movie_Id")] Movie_Actors movie_Actors) { if (ModelState.IsValid) { db.Entry(movie_Actors).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Actor_Id = new SelectList(db.Actors, "Id", "Name", movie_Actors.Actor_Id); ViewBag.Movie_Id = new SelectList(db.Movies, "Id", "Name", movie_Actors.Movie_Id); return(View(movie_Actors)); }
// GET: Movie_Actors/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Movie_Actors movie_Actors = db.Movie_Actors.Find(id); if (movie_Actors == null) { return(HttpNotFound()); } return(View(movie_Actors)); }
// GET: Movie_Actors/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Movie_Actors movie_Actors = db.Movie_Actors.Find(id); if (movie_Actors == null) { return(HttpNotFound()); } ViewBag.Actor_Id = new SelectList(db.Actors, "Id", "Name", movie_Actors.Actor_Id); ViewBag.Movie_Id = new SelectList(db.Movies, "Id", "Name", movie_Actors.Movie_Id); return(View(movie_Actors)); }