Пример #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);
        }
        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);
        }