public IActionResult Get()
 {
     try
     {
         var result = _tournamentRepository.GetAll();
         if (result.Any())
         {
             _logger.LogInformation("Successfully recieved Tournament Data.");
             return(Ok(result));
         }
         else
         {
             _logger.LogError("No Tournament data. Data - {0}", result);
             return(StatusCode(400, StatusCodes.ReturnStatusObject("No Tournament data.")));
         }
     }
     catch (Exception e)
     {
         _logger.LogError("Error recieving data. Error - {0}.", e.Message);
         return(StatusCode(400, StatusCodes.ReturnStatusObject("Error recieving Tournament data.")));
     }
 }
예제 #2
0
 public List <TournamentVM> GetAll()
 {
     return(_tournament.GetAll());
 }
예제 #3
0
        public IActionResult Get()
        {
            var results = _tournament.GetAll();

            return(Ok(results));
        }