public ActionResult UpdateMovie(int id) { DeltaXRepository obj = new DeltaXRepository(); DeltaXMapper <Movie, Models.Movie> mapobj = new DeltaXMapper <Movie, Models.Movie>(); ViewBag.producerList = obj.FetchProducer(); ViewBag.ActorList = obj.FetchActor(); var mov = obj.FetchMovie().Where(x => x.MovieId == id).Single(); return(View(mapobj.Translate(mov))); }
public ActionResult GetAllMovieDetails() { DeltaXMapper <Movie, Models.Movie> mapobj = new DeltaXMapper <Movie, Models.Movie>(); DeltaXRepository obj = new DeltaXRepository(); var mov = obj.FetchMovie(); var MovieList = new List <Models.Movie>(); MovieList = mov.Select(x => new Models.Movie { MovieName = x.MovieName, MoviePlot = x.MoviePlot, MoviePoster = x.MoviePoster, MovieYearOfRelease = x.MovieYearOfRelease, MovieId = x.MovieId, ProducerId = x.ProducerId, ProducerName = x.Producer.ProducerName, Actors = x.Actors.Select(z => z.ActorName).ToList() }).ToList(); return(View(MovieList)); }