public static IConfigurationBuilder AddEventStore(this IConfigurationBuilder configurationBuilder, string[] args, IDictionary environment, IEnumerable <KeyValuePair <string, object?> > defaultValues) { var builder = configurationBuilder .Add(new DefaultSource(defaultValues)) .Add(new EnvironmentVariablesSource(environment)) .Add(new CommandLineSource(args)); var root = builder.Build(); // need to build twice as on disk config is configurable var configurationPath = root.GetValue <string>("Config"); var yamlSource = new YamlSource { Path = configurationPath, Optional = true, ReloadOnChange = true }; yamlSource.ResolveFileProvider(); builder.Sources.Insert(1, yamlSource); return(builder); }
public Yaml(YamlSource source) : base(source) { }