private string GetByKey(string key) { Logger.Debug("Looking for {Key} in {SourceName} using keys {AttemptedKeys}", key, GetSourceName(), GetAttemptedKeys(key)); return(_namingConventions .Select(namingConvention => namingConvention.GetKey(key)) .Select(actualKey => _configurationSource.GetByKey(actualKey)) .FirstOrDefault(value => value != null)); }
private string GetByKey(string key) { foreach (var namingConvention in _namingConventions) { var attemptedKey = namingConvention.GetKey(key); var value = _configurationSource.GetByKey(attemptedKey); if (value != null) { _configurationReporter.AddValue(key, GetSourceName(), value, attemptedKey); return(value); } } _configurationReporter.AddMissing(key, GetSourceName(), GetAttemptedKeys(key)); return(null); }