Ejemplo n.º 1
0
        public async Task <ActionResult <MovieRatingViewModel> > GetMovieRating(int id)
        {
            try
            {
                var entity = await _movieRatingRepository.Get(id);

                return(GetMapperMovieRatingToMovieRatingViewModel(entity));
            }
            catch (MovieRatingNotFoundException e)
            {
                return(NotFound(new { message = e.Message }));
            }
            catch (Exception e)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, new { message = e.Message }));
            }
        }