public IActionResult Get()
 {
     try
     {
         var result = _marketRepository.GetAll();
         if (result.Any())
         {
             _logger.LogInformation("Successfully recieved Market Data.");
             return(Ok(result));
         }
         else
         {
             _logger.LogError("No Market data. Data - {0}", result);
             return(StatusCode(400, StatusCodes.ReturnStatusObject("No Market data.")));
         }
     }
     catch (Exception e)
     {
         _logger.LogError("Error recieving data. Error - {0}. Data - {1}", e.Message);
         return(StatusCode(400, StatusCodes.ReturnStatusObject("Error recieving Market data.")));
     }
 }
예제 #2
0
        public IActionResult Get()
        {
            var markets = _market.GetAll();

            return(Ok(markets));
        }