예제 #1
0
        public async Task <IActionResult> OnGetAsync()
        {
            var movie = await _movieService.GetMovieAsync(Id);

            Title = movie.Title;

            Cast = _mapper.Map <List <ActorViewModel> >(await _creditsService.GetTopCastAsync(movie.CreditId));
            Crew = _mapper.Map <List <ActorViewModel> >(await _creditsService.GetCrewAsync(movie.CreditId, new CrewCriteria()));

            return(Page());
        }
예제 #2
0
        public async Task <IActionResult> OnGetAsync()
        {
            var movie = await _movieService.GetMovieDetailsAsync(Id);

            if (movie == null)
            {
                return(NotFound());
            }

            if (User.Identity.IsAuthenticated)
            {
                var userId = _userManager.GetUserId(User);
                Vote = await _voteService.GetVoteAsync(userId, Id);
            }

            TopCast = await _creditsService.GetTopCastAsync(movie.CreditId, CastOnPage);

            Movie = _mapper.Map <MovieSummaryViewModel>(movie);
            return(Page());
        }