コード例 #1
0
 public Config Provide(string workingDirectory, Config overrideConfig = null)
 {
     return(new ConfigurationBuilder()
            .Add(configFileLocator.ReadConfig(workingDirectory))
            .Add(overrideConfig ?? new Config())
            .Build());
 }
コード例 #2
0
        public Config Provide(string workingDirectory, bool applyDefaults = true, Config overrideConfig = null)
        {
            var readConfig = configFileLocator.ReadConfig(workingDirectory);

            readConfig.Verify();

            if (applyDefaults)
            {
                readConfig.Reset();
            }
            if (null != overrideConfig)
            {
                readConfig.ApplyOverridesTo(overrideConfig);
            }
            return(readConfig);
        }
コード例 #3
0
        public static Config Provide(string workingDirectory, IConfigFileLocator configFileLocator, bool applyDefaults = true, Config overrideConfig = null)
        {
            var readConfig = configFileLocator.ReadConfig(workingDirectory);

            VerifyConfiguration(readConfig);

            if (applyDefaults)
            {
                ApplyDefaultsTo(readConfig);
            }
            if (null != overrideConfig)
            {
                ApplyOverridesTo(readConfig, overrideConfig);
            }
            return(readConfig);
        }