//Tarea mostrar 3 peliculasactormodel en una vista public ActionResult GetPeliculaActor() { PeliculaActorModel peliculaActorModel = new PeliculaActorModel(); PeliculaModel pelicula = new PeliculaModel(); ActorModel actor = new ActorModel(); #region opcion1 //peliculaActorModel.Pelicula.Id = 1; //peliculaActorModel.Pelicula.Titulo = "Avengers"; //peliculaActorModel.Pelicula.Duracion = 158; //peliculaActorModel.Pelicula.Genero = "Accion"; //peliculaActorModel.Actor.Id = 1; //peliculaActorModel.Actor.Nombre = "Jonhy Deep"; //peliculaActorModel.Actor.Edad = 32; #endregion pelicula.Id = 1; pelicula.Titulo = "Avengers"; pelicula.Duracion = 158; pelicula.Genero = "Accion"; actor.Id = 1; actor.Nombre = "Jonhy Deep"; actor.Edad = 32; peliculaActorModel.Pelicula = pelicula; peliculaActorModel.Actor = actor; return(View("PeliculaActor", peliculaActorModel)); }
public ActionResult GetPeliculaActor() { PeliculaActorModel peliculaActorModel = new PeliculaActorModel(); PeliculaModel pelicula = new PeliculaModel(); ActorModel actor = new ActorModel(); pelicula.Id = 1; pelicula.Titulo = "Avengers"; pelicula.Duracion = 160; pelicula.Genero = "Acción"; actor.Id = 1; actor.Nombre = "Jony deep"; actor.Edad = 32; peliculaActorModel.Pelicula = pelicula; peliculaActorModel.Actor = actor; return(View("PeliculaActor", peliculaActorModel)); }
//public ActionResult() //{ // var list3Pelicualas = GetListPeliculaPrimeras3().ToList(); // var list5Pelicualas = GetListPeliculaPrimeras3().ToList(); //} public List <PeliculaActorModel> GetListPeliculaPrimeras3() { PeliculaActorModel peliculaActorModel = new PeliculaActorModel(); PeliculaModel pelicula = new PeliculaModel(); ActorModel actor = new ActorModel(); for (int i = 0; i < 3; i++) { switch (i) { case 0: pelicula.Id = 1; pelicula.Genero = "Comedia"; pelicula.Titulo = "Forest Gump"; pelicula.Duracion = 180; actor.Id = 1; actor.Nombre = "Tom Hanks"; actor.Edad = 63; //peliculaActor.Pelicula = pelicula; //peliculaActor.Actor = actor; break; case 1: pelicula.Id = 2; pelicula.Genero = "Accion"; pelicula.Titulo = "Club de la pelea"; pelicula.Duracion = 180; actor.Id = 2; actor.Nombre = "Brat Pitt"; actor.Edad = 47; //peliculaActor.Pelicula = pelicula; //peliculaActor.Actor = actor; break; case 2: pelicula.Id = 3; pelicula.Genero = "Accion"; pelicula.Titulo = "Transformers"; pelicula.Duracion = 120; actor.Id = 3; actor.Nombre = "Megan Fox"; actor.Edad = 31; //peliculaActor.Pelicula = pelicula; //peliculaActor.Actor = actor; break; default: break; } peliculaActorModel.AddPeliculaActor(pelicula, actor); } var LstPeliculaActores = peliculaActorModel.GetPeliculaActorModels(); return(LstPeliculaActores); }