mirror of https://github.com/abpframework/abp.git
1 changed files with 26 additions and 0 deletions
@ -0,0 +1,26 @@ |
|||||
|
using Microsoft.Extensions.Configuration; |
||||
|
using Microsoft.Extensions.DependencyInjection; |
||||
|
|
||||
|
namespace Microsoft.Extensions.Hosting |
||||
|
{ |
||||
|
public static class AbpAspNetCoreHostBuilderExtensions |
||||
|
{ |
||||
|
public const string AppSettingsSecretJsonPath = "appsettings.secrets.json"; |
||||
|
|
||||
|
public static IHostBuilder AddAppSettingsSecretsJson( |
||||
|
this IHostBuilder hostBuilder, |
||||
|
bool optional = true, |
||||
|
bool reloadOnChange = true, |
||||
|
string path = AppSettingsSecretJsonPath) |
||||
|
{ |
||||
|
return hostBuilder.ConfigureAppConfiguration(appConfig => |
||||
|
{ |
||||
|
appConfig.AddJsonFile( |
||||
|
path: AppSettingsSecretJsonPath, |
||||
|
optional: optional, |
||||
|
reloadOnChange: reloadOnChange |
||||
|
); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue