Пример #1
0
        private int RemoveDeadIsins()
        {
            var namesInEntities = _marketDataCsvFileRepository
                                  .Entities
                                  .Select(e => e.Name)
                                  .Distinct();

            var deadNames = _isinsCsvFileRepository.GetNames().Except(namesInEntities);

            deadNames.ToList().ForEach(name => _isinsCsvFileRepository.Remove(name));

            return(deadNames.Count());
        }
Пример #2
0
        private void RemoveDeadIsins()
        {
            _logger.Info("Removing discontinued ISIN(s) ...");

            var namesInEntities = _marketDataCsvFileRepository
                                  .Entities
                                  .Select(e => e.Name)
                                  .Distinct();

            var deadNames = _isinsCsvFileRepository.GetNames().Except(namesInEntities).ToArray();

            if (deadNames.Any())
            {
                foreach (var name in deadNames)
                {
                    _isinsCsvFileRepository.Remove(name);
                }
                _logger.Info($"{deadNames.Count()} ISIN(s) are removed.");
            }
            else
            {
                _logger.Info($"No ISINs were removed.");
            }
        }