修复路由启动bug

This commit is contained in:
xuejiaming 2022-05-20 15:18:43 +08:00
parent f214578e60
commit 7c4b44a4c9
2 changed files with 4 additions and 3 deletions

View File

@ -61,8 +61,8 @@ namespace Sample.AutoCreateIfPresent
var tableName = dataTable.Rows[i][TABLE_NAME]?.ToString() ?? string.Empty;
if (tableName.StartsWith(CurrentTableName,StringComparison.OrdinalIgnoreCase))
{
//如果没有下划线那么需要CurrentTableName.Length-1
_tails.TryAdd(tableName.Substring(CurrentTableName.Length), null);
//如果没有下划线那么需要CurrentTableName.Length
_tails.TryAdd(tableName.Substring(CurrentTableName.Length+1), null);
}
}
}

View File

@ -79,7 +79,8 @@ namespace Sample.AutoCreateIfPresent
var tableName = dataTable.Rows[i][TABLE_NAME]?.ToString()??string.Empty;
if (tableName.StartsWith(CurrentTableName, StringComparison.OrdinalIgnoreCase))
{
//如果没有下划线那么需要CurrentTableName.Length-1
//如果没有下划线那么需要CurrentTableName.Length
var substring = tableName.Substring(CurrentTableName.Length+1);
_tails.TryAdd(tableName.Substring(CurrentTableName.Length),null);
}
}