Ejemplo n.º 1
0
        public ActionResult Index()
        {
            var movies = _movieLogic.GetAllMovies(MiscHelper.GetCurrentUserIdOrZero(this)).ToList();

            if (User.Identity.IsAuthenticated)
            {
                movies = _movieLogic.CheckIfMoviesAreFavourites(movies, MiscHelper.GetCurrentUserIdOrZero(this));
            }

            var movieViewModels = ModelToViewModel.ToMovieViewModels(movies);

            foreach (var movie in movieViewModels)
            {
                movie.GenresString = MiscHelper.GetStringFromGenreViewModels(movie.Genres);
            }
            return(View(movieViewModels));
        }