public static IConfigurationBuilder AddAppSettingsFile(this IConfigurationBuilder configurationBuilder, bool optional)
        {
            var appSettingsFilePath = AppSettings.GetDefaultFilePath();

            configurationBuilder.AddAppSettingsFile(appSettingsFilePath, optional, DummyLogger.Instance);
            return(configurationBuilder);
        }
        /// <summary>
        /// Adds the default appsettings.json file.
        /// </summary>
        public static IConfigurationBuilder AddAppSettingsFile(this IConfigurationBuilder configurationBuilder, ILogger logger)
        {
            var appSettingsFilePath = AppSettings.GetDefaultFilePath();

            configurationBuilder.AddAppSettingsFile(appSettingsFilePath, logger);
            return(configurationBuilder);
        }
        public static IConfigurationBuilder AddDefaultConfiguration(this IConfigurationBuilder configurationBuilder, bool appSettingsFileIsOptional, ILogger logger)
        {
            configurationBuilder
            .AddAppSettingsFile(appSettingsFileIsOptional, logger)
            .AddAspNetCoreEnvironmentSpecificAppSettingsFile(logger)
            ;

            return(configurationBuilder);
        }
        public static IConfigurationBuilder AddAspNetCoreEnvironmentSpecificAppSettingsFile(this IConfigurationBuilder configurationBuilder, ILogger logger)
        {
            var aspNetCoreEnvironment = AspNetCoreEnvironment.GetValue();

            if (aspNetCoreEnvironment != AspNetCoreEnvironmentValue.None)
            {
                var aspNetCoreSpecificAppSettingsJsonFilePath = AppSettings.GetFilePathForEnvironment();

                configurationBuilder.AddAppSettingsFile(aspNetCoreSpecificAppSettingsJsonFilePath, true, logger);
            }

            return(configurationBuilder);
        }
 public static IConfigurationBuilder AddAppSettingsFile(this IConfigurationBuilder configurationBuilder)
 {
     configurationBuilder.AddAppSettingsFile(DummyLogger.Instance);
     return(configurationBuilder);
 }
 public static IConfigurationBuilder AddAppSettingsFile(this IConfigurationBuilder configurationBuilder, FilePath appSettingsFilePath, ILogger logger)
 {
     configurationBuilder.AddAppSettingsFile(appSettingsFilePath, false, logger);
     return(configurationBuilder);
 }