refactor(#I12XDG): 增加对 SqlFolder 配置项未配置时保护
#Issue link #I12XDG
This commit is contained in:
parent
77e1b847da
commit
725a6dffe6
|
@ -15,7 +15,7 @@ namespace Microsoft.AspNetCore.Builder
|
||||||
{
|
{
|
||||||
private static bool _init;
|
private static bool _init;
|
||||||
private static object _locker = new object();
|
private static object _locker = new object();
|
||||||
|
private const string SqlFolderKey = "SqlFolder";
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 自动生成数据库中间件
|
/// 自动生成数据库中间件
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -36,7 +36,7 @@ namespace Microsoft.AspNetCore.Builder
|
||||||
var dbSection = config.GetSection("DB").GetChildren().FirstOrDefault(c => c.GetValue("Enabled", false));
|
var dbSection = config.GetSection("DB").GetChildren().FirstOrDefault(c => c.GetValue("Enabled", false));
|
||||||
if (dbSection != null)
|
if (dbSection != null)
|
||||||
{
|
{
|
||||||
var folder = dbSection["SqlFolder"].ReplaceOSPlatformPath();
|
var folder = dbSection[SqlFolderKey]?.ReplaceOSPlatformPath();
|
||||||
if (!string.IsNullOrEmpty(folder))
|
if (!string.IsNullOrEmpty(folder))
|
||||||
{
|
{
|
||||||
// 判断文件夹是否存在
|
// 判断文件夹是否存在
|
||||||
|
|
Loading…
Reference in New Issue