Example #1
0
        private async Task PerformDayUpdate(DateTime date)
        {
            string updateData;

            try
            {
                updateData = await _stockQuotesDownloadService.DownloadUpdate(_projectSettings, date);
            }
            catch (Exception e)
            {
                _logger.LogError($"Could not get update file for day {date.ToShortDateString()}. Skipping. {e.Message}");
                return;
            }
            var quotes = _stocksBulkDeserializer
                         .Deserialize(updateData)
                         .Where(x => !_projectSettings.ExcludeBlacklisted || !_projectSettings.BlackListPattern.IsMatch(x.Ticker))
                         .ToList();

            EnrichQuotes(quotes, date);

            _stockQuoteRepository.AddRange(quotes);
        }
 public void AddRange(IEnumerable <StockQuote> entities)
 {
     _stockQuoteRepository.AddRange(entities);
 }