mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2026-02-27 16:50:33 +08:00
Update split table
This commit is contained in:
@@ -60,7 +60,7 @@ namespace SqlSugar
|
|||||||
{
|
{
|
||||||
if (StaticConfig.SplitTableGetTablesFunc != null)
|
if (StaticConfig.SplitTableGetTablesFunc != null)
|
||||||
{
|
{
|
||||||
return StaticConfig.SplitTableGetTablesFunc();
|
return GetCustomGetTables();
|
||||||
}
|
}
|
||||||
var oldIsEnableLogEvent = this.Context.Ado.IsEnableLogEvent;
|
var oldIsEnableLogEvent = this.Context.Ado.IsEnableLogEvent;
|
||||||
this.Context.Ado.IsEnableLogEvent = false;
|
this.Context.Ado.IsEnableLogEvent = false;
|
||||||
@@ -74,6 +74,16 @@ namespace SqlSugar
|
|||||||
return result;
|
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()
|
public string GetDefaultTableName()
|
||||||
{
|
{
|
||||||
return Service.GetTableName(this.Context,EntityInfo);
|
return Service.GetTableName(this.Context,EntityInfo);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<package >
|
<package >
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>SqlSugarCore</id>
|
<id>SqlSugarCore</id>
|
||||||
<version>5.1.4.138</version>
|
<version>5.1.4.139-preview01</version>
|
||||||
<authors>sunkaixuan</authors>
|
<authors>sunkaixuan</authors>
|
||||||
<owners>果糖大数据科技</owners>
|
<owners>果糖大数据科技</owners>
|
||||||
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>
|
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>
|
||||||
|
|||||||
Reference in New Issue
Block a user