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."); } }
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)); } }