コード例 #1
0
        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);
        }
コード例 #2
0
 public Yaml(YamlSource source) : base(source)
 {
 }