Beispiel #1
0
        public async Task <IActionResult> GetMovieById([FromRoute] string movieId)
        {
            var response = await _movieService.GetMovieByIdAsync(new Services.GetMovieByIdRequest
            {
                MovieId = movieId
            });

            if (response?.Movie is null)
            {
                return(NotFound());
            }

            return(Ok(_mapper.Map <Movie>(response.Movie)));
        }
Beispiel #2
0
        public async Task <Movie?> GetMovieById(string movieId)
        {
            var response = await _movieService.GetMovieByIdAsync(new Services.GetMovieByIdRequest
            {
                MovieId = movieId
            });

            return(response.Movie is null ? null : _mapper.Map <Movie>(response.Movie));
        }