Esempio n. 1
0
        private static void TestReadMovie(string code)
        {
            Movie movie = null;

            Console.WriteLine($"Testing reading movie '{code}'.");
            movie = _businessLogicLayer.ReadMovie(code);
            if (movie != null)
            {
                Console.WriteLine(movie.ToString());
            }
            else
            {
                Console.WriteLine($"Movie '{code}' does not exist.");
            }
        }
Esempio n. 2
0
        public IActionResult GetMovie(string code)
        {
            try
            {
                _logger.LogInformation($"api/Movies/CRUD:GetMovie: " +
                                       $"Code: {code}");

                return(Ok(_businessLogicLayer.ReadMovie(code)));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }