public async Task <IActionResult> GetVoteMenu(int movieId)
        {
            var userId = _userManager.GetUserId(User);
            var vote   = await _voteService.GetVoteAsync(userId, movieId);

            return(PartialView("Movie/VoteMenu", vote));
        }
Beispiel #2
0
        public async Task <ActionResult <VoteGetViewModel> > GetVoteAsync([FromRoute] Guid voteId)
        {
            var vote = await _voteService.GetVoteAsync(voteId);

            if (vote != null)
            {
                return(NotFound());
            }
            var voteModel = _mapper.Map <VoteGetViewModel>(vote);

            return(Ok(voteModel));
        }
Beispiel #3
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());
        }