mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-10-15 18:55:07 +08:00
Codefirst bug table name with database name
This commit is contained in:
@@ -7,5 +7,19 @@ namespace SqlSugar
|
||||
{
|
||||
public class SqlServerCodeFirst:CodeFirstProvider
|
||||
{
|
||||
protected override string GetTableName(EntityInfo entityInfo)
|
||||
{
|
||||
var table= this.Context.EntityMaintenance.GetTableName(entityInfo.EntityName);
|
||||
var tableArray = table.Split('.');
|
||||
var noFormat = table.Split(']').Length==1;
|
||||
if (tableArray.Length > 2 && noFormat)
|
||||
{
|
||||
return tableArray.Last();
|
||||
}
|
||||
else
|
||||
{
|
||||
return table;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user