Exemplo n.º 1
0
 private static void TestReadMatchingMovies(string searchFor, string codeGreaterThan, int blockSize)
 {
     Console.WriteLine($"Testing reading the next batch of {blockSize} movies \nthat match with '{searchFor}' and are greater that '{codeGreaterThan}'.");
     foreach (Movie movie in _businessLogicLayer.ReadMatchingMovies(searchFor, codeGreaterThan, blockSize))
     {
         Console.WriteLine($"Movie code: '{movie.Code}'");
     }
 }
Exemplo n.º 2
0
        public IActionResult GetMatchingMovies([FromBody] SearchCriteria searchCriteria)
        {
            try
            {
                _logger.LogInformation($"api/Movies/Search:GetSearchMatches " +
                                       $"Search Criteria: {searchCriteria.ToString()}");

                return(Ok(_businessLogicLayer.ReadMatchingMovies(searchCriteria.SearchFor, searchCriteria.CodeGreaterThan, searchCriteria.BlockSize)));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }