U:调整所有代码格式
This commit is contained in:
1 parent
d133bacf55
commit
155b67e831
342 files changed
+9431
-9868
No files matched your search
@@ -22,23 +22,20 @@ public static class ConfigBuilderExtensions
|
||||
|
||||
// 根据环境添加特定配置
|
||||
var environment = Environment.GetEnvironmentVariable("DOTNET_ENVIRONMENT")
|
||||
?? Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")
|
||||
?? "Production";
|
||||
?? Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")
|
||||
?? "Production";
|
||||
|
||||
var envConfigFile = $"appsettings.{environment}.json";
|
||||
var envConfigPath = Path.Combine(basePath, envConfigFile);
|
||||
if (File.Exists(envConfigPath))
|
||||
{
|
||||
configFiles.Add(envConfigFile);
|
||||
}
|
||||
if (File.Exists(envConfigPath)) configFiles.Add(envConfigFile);
|
||||
|
||||
// 构建配置
|
||||
return ConfigBuilder.BuildFromFiles(
|
||||
configFiles.ToArray(),
|
||||
reloadOnChange: true,
|
||||
includeEnvironment: true,
|
||||
environmentPrefix: environmentPrefix,
|
||||
basePath: basePath
|
||||
true,
|
||||
true,
|
||||
environmentPrefix,
|
||||
basePath
|
||||
);
|
||||
}
|
||||
|
||||
@@ -51,9 +48,9 @@ public static class ConfigBuilderExtensions
|
||||
|
||||
return ConfigBuilder.BuildFromFiles(
|
||||
new[] { "appsettings.json" },
|
||||
reloadOnChange: false,
|
||||
includeEnvironment: false,
|
||||
false,
|
||||
false,
|
||||
basePath: basePath
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user