Beispiel #1
0
        public virtual JsonResult GetMovieDetailsModal(int MovieId)
        {
            var movie = repository.GetMovieById(MovieId);

            return(Json(new
            {
                movieTitle = movie.Title,
                movieDescription = movie.Description,
                movieReleaseDate = movie.ReleaseDate,
                movieActors = movie.Actors,
                movieRating = movie.Rating,
                movieGenres = movie.Genres
            }, JsonRequestBehavior.AllowGet));
        }
        // GET: Movie/Details/5
        public ActionResult Details(int id)
        {
            var movie = repository.GetMovieById(id);

            List <Actor> actorsInMovie = repository.GetActorsByMovieId(id).ToList();

            var model = new MovieViewModel()
            {
                Title       = movie.Title,
                Description = movie.Description,
                MyRating    = movie.Rating,
                Actors      = actorsInMovie,
                ReleaseDate = movie.ReleaseDate,
                ImagePath   = movie.ImagePath,
            };

            return(View(model));
        }