Beispiel #1
0
        public IActionResult Index()
        {
            var GetTopMovies       = _movieService.GetTopPopularMovie();
            var GetPopularDirector = _directorService.GetDirectorByPopularity();
            var GetTopPopularMoviesByBestSellingDirector = _movieService.GetTopPopularMoviesByBestSellingDirector(GetPopularDirector.Id);
            var GetAllMovies         = _movieService.GetAllMovies();
            var notificationCounters = _rentingMovieService.GetAllItemsInCart().Count();
            var movieViewModel       = new MovieViewModel
            {
                TopPopularMovies = GetTopMovies,
                TopPopularMoviesByBestSellingDirector = GetTopPopularMoviesByBestSellingDirector,
                BestSellingDirector   = GetPopularDirector,
                AllMovies             = GetAllMovies,
                AddToCartTotalCounter = notificationCounters
            };

            ViewData["Counter"] = notificationCounters;
            return(View(movieViewModel));
        }