public IActionResult GetMatchOdds(int matchId) { try { if (!_matchInfoRepository.MatchExists(matchId)) { _logger.LogInformation($"Match with {matchId} wasn't found"); return(NotFound()); } var matchOddsForMatch = _matchInfoRepository.GetMatchOddsForMatch(matchId); return(Ok(_mapper.Map <IEnumerable <MatchOddsDto> >(matchOddsForMatch))); } catch (Exception ex) { _logger.LogCritical("Exception happened!", ex); return(StatusCode(500, "A problem happened while handling your request.")); } }