mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-01 10:10:16 +08:00
Codefirst bug table name with database name
This commit is contained in:
parent
3f9cec6dca
commit
7ad167dec3
@ -7,5 +7,19 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
public class SqlServerCodeFirst:CodeFirstProvider
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user