Пример #1
0
        public async Task <IActionResult> GetMovieRecommendations(string movieId)
        {
            var moviedbapi = new MovieDbApiClient.MovieDbApiClient();
            var results    = await moviedbapi.GetMovieRecommendations(movieId);

            return(View("SearchMovieApi", results));
        }
Пример #2
0
        public async Task <IActionResult> SearchMovieApi(string title, string year)
        {
            ViewBag.SearchString = title;
            var moviedbapi = new MovieDbApiClient.MovieDbApiClient();

            return(View(await moviedbapi.SearchMovieApi(title)));
        }
Пример #3
0
        public async Task <IActionResult> Index()
        {
            var moviedbapi  = new MovieDbApiClient.MovieDbApiClient();
            var popularList = await moviedbapi.GetPopularMovies();

            ViewBag.PopularMovieList = popularList;

            if (_session.GetInt32("currentUserId") != null)
            {
                var userId      = (int)_session.GetInt32("currentUserId");
                var movieIdList = _context.UserMovie.Where(m => m.UserId == userId)
                                  .Select(m => m.MovieDbApiId).ToList();

                ViewBag.UsersFavorites = await moviedbapi.GetUsersMovies(movieIdList);
            }

            return(View());
        }
Пример #4
0
        public async Task <IActionResult> GetMovieDetails(string movieId)
        {
            var moviedbapi = new MovieDbApiClient.MovieDbApiClient();

            return(View(await moviedbapi.GetMovieDetails(movieId)));
        }