Beispiel #1
0
 /// <summary>
 /// Adds default and configuration name-specific appsettings.json files.
 /// </summary>
 protected override void ConfigureConfigurationBody(IConfigurationBuilder configurationBuilder, IServiceProvider configurationServiceProvider)
 {
     configurationBuilder
     .AddDefaultAppSettingsJsonFile(configurationServiceProvider)
     .AddConfigurationSpecificAppSettingsJsonFile(configurationServiceProvider, true)     // Make the configuration-name-specific appsettings file optional since all configuration might just be in the default appsettings file.
     ;
 }
Beispiel #2
0
        /// <summary>
        /// Adds the default and configuration name-specific appsettings.json files to the configuration.
        /// Defaults make the default appsettings.json file non-optional, and the configuration name-specific appsettings file optional since all configuration might just be in the default appsettings file.
        /// </summary>
        public static IConfigurationBuilder AddDefaultAndConfigurationSpecificAppSettingsJsonFiles(this IConfigurationBuilder configurationBuilder, IServiceProvider configurationServiceProvider, bool defaultIsOptional = false, bool configurationSpecificIsOptional = true)
        {
            configurationBuilder
            .AddDefaultAppSettingsJsonFile(configurationServiceProvider, defaultIsOptional)
            .AddConfigurationSpecificAppSettingsJsonFile(configurationServiceProvider, configurationSpecificIsOptional)
            ;

            return(configurationBuilder);
        }
Beispiel #3
0
 /// <summary>
 /// Adds configuration files in a service-less way.
 /// If overridden, call the base implementation first.
 /// </summary>
 protected virtual void ConfigureConfigurationBodyServiceLess(IConfigurationBuilder configurationBuilder)
 {
     configurationBuilder
     .AddDefaultAppSettingsJsonFile()
     ;
 }
 protected override void ConfigureConfigurationBody(IConfigurationBuilder configurationBuilder, IServiceProvider emptyConfigurationServicesProvider)
 {
     configurationBuilder
     .AddDefaultAppSettingsJsonFile()
     ;
 }