mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-12-26 01:45:49 +08:00
- 移除 FreeSql.Repository 扩展方法 FromRepository;
- 调整 ISelect.AsTable 规则,每一次使用将增加 UNION ALL 查询; - 优化 AsTable UseSyncStructureToLower/ToUpper 设置,兼容 AsTable((t,o) => "(select * from tb)"); #89
This commit is contained in:
@@ -810,13 +810,12 @@
|
||||
<member name="M:FreeSql.ISelect0`2.AsTable(System.Func{System.Type,System.String,System.String})">
|
||||
<summary>
|
||||
设置表名规则,可用于分库/分表,参数1:实体类型;参数2:默认表名;返回值:新表名; <para></para>
|
||||
设置后可查询分表后的多个子表记录,以 UNION ALL 形式执行。 <para></para>
|
||||
设置多次,可查询分表后的多个子表记录,以 UNION ALL 形式执行。 <para></para>
|
||||
如:select.AsTable((type, oldname) => "table_1").AsTable((type, oldname) => "table_2").AsTable((type, oldname) => "table_3").ToSql(a => a.Id); <para></para>
|
||||
select * from (SELECT a."Id" as1 FROM "table_1" a) ftb <para></para>
|
||||
UNION ALL<para></para>
|
||||
select * from (SELECT a."Id" as1 FROM "table_2" a) ftb <para></para>
|
||||
UNION ALL<para></para>
|
||||
select * from (SELECT a."Id" as1 FROM "table_3" a) ftb
|
||||
UNION ALL select * from (SELECT a."Id" as1 FROM "table_2" a) ftb <para></para>
|
||||
UNION ALL select * from (SELECT a."Id" as1 FROM "table_3" a) ftb <para></para>
|
||||
还可以这样:select.AsTable((a, b) => "(select * from tb_topic where clicks > 10)").Page(1, 10).ToList()
|
||||
</summary>
|
||||
<param name="tableRule"></param>
|
||||
<returns></returns>
|
||||
|
||||
Reference in New Issue
Block a user