public async Task <IActionResult> GetHistoryOfMatchesByLeagueId([FromRoute] GetHistoryOfMatchesByLeagueIdQuery query)
        {
            _logger.LogInformation(LoggingEvents.ListItems, "Getting latest matches from league {id}", query.LeagueId);
            IEnumerable <MatchBasicDTO> matches = await CommandAsync(query);

            if (matches == null)
            {
                _logger.LogWarning(LoggingEvents.GetItemNotFound, "latest matches from league {id} not found", query.LeagueId);
                return(NotFound());
            }

            return(Ok(matches));
        }
Пример #2
0
 public async Task <IEnumerable <MatchBasicDTO> > Handle(GetHistoryOfMatchesByLeagueIdQuery request, CancellationToken cancellationToken)
 => await _service.GetHistoryOfMatchesByLeagueId(request.LeagueId);