- 移除 FreeSql.Repository 扩展方法 FromRepository;

- 调整 ISelect.AsTable 规则,每一次使用将增加 UNION ALL 查询;
- 优化 AsTable UseSyncStructureToLower/ToUpper 设置,兼容 AsTable((t,o) => "(select * from tb)"); #89
This commit is contained in:
28810
2019-09-10 09:26:08 +08:00
parent 7fcb2ed601
commit fa61d8a3d1
16 changed files with 168 additions and 253 deletions

View File

@ -69,13 +69,12 @@ namespace FreeSql
/// <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>