mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 04:18:16 +08:00
- 增加 自动分表 IAsTable.SetDefaultAllTables 拦截未使用 where 条件的场景;修复 自动分表 IAsTable.SetTableName 位置 bug;
This commit is contained in:
@ -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();
|
||||
|
@ -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[]
|
||||
{
|
||||
|
Reference in New Issue
Block a user