예제 #1
0
        public IActionResult GetMovie(long id)
        {
            var movie = _movieServices.GetMovie(id);

            if (movie == null)
            {
                return(NotFound(new NotFoundDto()));
            }
            return(Ok(new MovieDetailDto(movie)));
        }
예제 #2
0
        public ActionResult <MovieResponse> GetMovie(int id)
        {
            MovieResponse movieResponse = movieServices.GetMovie(id);

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

            return(movieResponse);
        }
        public ActionResult GetMovie(int movieId)
        {
            try
            {
                var resultData = movieServices.GetMovie(movieId);

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

                return(Ok(ServicesExtension.SuccessfulResult(resultData)));
            }
            catch (Exception exp)
            {
                return(new JsonResult(ServicesExtension.ErrorResult(exp)));
            }
        }