Esempio n. 1
0
        private async Task <List <int> > GetInplayGameIds()
        {
            var result   = new List <int>();
            var response =
                await _betsApiClient.GetInplayEventsAsync((int)SportId.TableTennis, _configuration.BetsApiAccessToken);

            if (response?.Results == null)
            {
                return(result);
            }

            foreach (var e in response.Results)
            {
                var wasRetrieved = await _eventsRepository.ExistsAsync(e.Id);

                if (wasRetrieved)
                {
                    continue;
                }

                result.Add(e.Id);
                await _eventsRepository.AddAsync(e.Id);
            }

            return(result);
        }