- 增加 自动分表 IAsTable.SetDefaultAllTables 拦截未使用 where 条件的场景;修复 自动分表 IAsTable.SetTableName 位置 bug;

This commit is contained in:
2881099
2023-12-11 16:48:02 +08:00
parent 0c6cf079e1
commit 4155596933
5 changed files with 50 additions and 120 deletions

View File

@ -23,7 +23,7 @@ class ModAsTableImpl : IAsTable
public string[] AllTables { get; }
public string GetTableNameByColumnValue(object columnValue, bool autoExpand = false)
public string GetTableNameByColumnValue(object columnValue, bool autoExpand = false)
{
var modid = (int)columnValue;
return $"order_{(modid % 10)}";
@ -43,6 +43,10 @@ class ModAsTableImpl : IAsTable
return tables;
}
public IAsTable SetDefaultAllTables(Func<string[], string[]> audit)
{
throw new NotImplementedException();
}
public IAsTable SetTableName(int index, string tableName)
{
throw new NotImplementedException();

View File

@ -618,7 +618,12 @@ namespace base_entity
fsql.CodeFirst.GetTableByEntity(typeof(AsTableLog)).AsTableImpl
.SetTableName(0, "AsTableLog1")
.SetTableName(1, "AsTableLog2");
.SetTableName(1, "AsTableLog2")
.SetDefaultAllTables(value =>
{
if (value.Length > 3) return value.Take(3).ToArray();
return value;
});
var testitems = new[]
{