/// <summary> /// Loads all persisted external link definitions across all setting layers. /// </summary> public IReadOnlyList <ExternalLinkDefinition> Get(RepoDistSettings settings) { if (settings == null) { throw new ArgumentNullException(nameof(settings)); } var cachedSettings = new RepoDistSettings(null, settings.SettingsCache); IEnumerable <ExternalLinkDefinition> effective = _externalLinksLoader.Load(cachedSettings); if (settings.LowerPriority != null) { var lowerPriorityLoader = new ConfiguredLinkDefinitionsProvider(_externalLinksLoader); effective = effective.Union(lowerPriorityLoader.Get(settings.LowerPriority)); } return(effective.ToList()); }
/// <summary> /// Loads all persisted external link definitions across all setting layers. /// </summary> public IReadOnlyList <ExternalLinkDefinition> Get(RepoDistSettings settings) { if (settings is null) { throw new ArgumentNullException(nameof(settings)); } var cachedSettings = new RepoDistSettings(null, settings.SettingsCache, SettingLevel.Unknown); IEnumerable <ExternalLinkDefinition>?effective = _externalLinksStorage.Load(cachedSettings); Assumes.NotNull(effective); if (settings.LowerPriority is not null) { var lowerPriorityLoader = new ConfiguredLinkDefinitionsProvider(_externalLinksStorage); effective = effective.Union(lowerPriorityLoader.Get(settings.LowerPriority)); } return(effective.ToList()); }