Synchronization code

This commit is contained in:
sunkaixuan
2024-02-02 18:58:59 +08:00
parent e89b526f81
commit 516de776fe

View File

@@ -60,7 +60,7 @@ namespace SqlSugar
{
if (StaticConfig.SplitTableGetTablesFunc != null)
{
return StaticConfig.SplitTableGetTablesFunc();
return GetCustomGetTables();
}
var oldIsEnableLogEvent = this.Context.Ado.IsEnableLogEvent;
this.Context.Ado.IsEnableLogEvent = false;
@@ -74,6 +74,16 @@ namespace SqlSugar
return result;
}
private List<SplitTableInfo> GetCustomGetTables()
{
var oldIsEnableLogEvent = this.Context.Ado.IsEnableLogEvent;
this.Context.Ado.IsEnableLogEvent = false;
var tables = StaticConfig.SplitTableGetTablesFunc();
List<SplitTableInfo> result = Service.GetAllTables(this.Context, EntityInfo, tables.Select(it=>new DbTableInfo() { Name=it.TableName }).ToList());
this.Context.Ado.IsEnableLogEvent = oldIsEnableLogEvent;
return result.ToList();
}
public string GetDefaultTableName()
{
return Service.GetTableName(this.Context,EntityInfo);