public async Task <Result> PullMatches(DateTime startDate) { var query = new MatchesForTheNext24HoursQuery() { StartDate = startDate }; var result = await _queryProcessor.ProcessAsync(query); await MatchFeed(result.Value); return(await Task.FromResult(Result.Ok())); }
public async Task <Result <IEnumerable <MatchResult> > > ExecuteAsync(MatchesForTheNext24HoursQuery query) { var matches = _matchRepo.GetForTheNext24Hours(query.StartDate); if (matches == null) { return(await Task.FromResult( Result.Ok(Enumerable.Empty <MatchResult>()) )); } return(await Task.FromResult( Result.Ok( matches.Select(x => MatchResultFactory.Create(x))) )); }