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()); }
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."); } }