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."))); } }
public List <TournamentVM> GetAll() { return(_tournament.GetAll()); }
public IActionResult Get() { var results = _tournament.GetAll(); return(Ok(results)); }