Ejemplo n.º 1
0
        public void Update(IEnumerable <IMarketDataEntity> latestData)
        {
            _logger.Info("Updating and saving market data ...");

            var entities = latestData.ToImmutableList();

            if (entities.Any())
            {
                _marketDataCsvFileRepository.AddRange(entities);
                _logger.Info("Market data updated.");

                _marketDataCsvFileRepository.SaveChanges();
                _logger.Info("Market data saved.");
            }
            else
            {
                _logger.Info("No market data to add.");
            }
        }
Ejemplo n.º 2
0
        public void UpdateMarketData(IEnumerable <IMarketDataEntity> latestData)
        {
            if (latestData is null)
            {
                throw new ArgumentNullException(nameof(latestData));
            }

            if (!latestData.Any())
            {
                _logger.Warn("No market data to add.");
                return;
            }

            _logger.Info("Updating and saving market data ...");

            var entities = latestData.ToImmutableArray();

            _marketDataCsvFileRepository.AddRange(entities);
            _logger.Info("Market data updated.");

            _marketDataCsvFileRepository.SaveChanges();
            _logger.Info("Market data saved.");
        }