mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 12:28:15 +08:00
## v0.1.13
- 修改 连接池内部 Ping Timeout 值暂定 5秒; - 优化 初始化时若数据库超时,则放弃预热; - FreeSql.Repository 下增加 ISelect.FromRepository 扩展方法,实现分表的多表查询; - 增加 FreeSql.Repository Autofac 泛型注入,可利用实现全局过滤+分表分库; - 补充 GuidRepository 插入数据时,根据 filter 参数设定进行数据验证;
This commit is contained in:
@ -548,6 +548,24 @@ namespace FreeSql.Tests.Sqlite {
|
||||
|
||||
[Fact]
|
||||
public void AsTable() {
|
||||
|
||||
var tenantId = 1;
|
||||
var reposTopic = g.sqlite.GetGuidRepository<Topic>(null, oldname => $"{oldname}_{tenantId}");
|
||||
var reposType = g.sqlite.GetGuidRepository<TestTypeInfo>(null, oldname => $"{oldname}_{tenantId}");
|
||||
|
||||
//reposTopic.Delete(Guid.Empty);
|
||||
//reposTopic.Find(Guid.Empty);
|
||||
//reposTopic.Update(new Topic { TestTypeInfoGuid = 1 });
|
||||
var sql11 = reposTopic.Select
|
||||
|
||||
.FromRepository(reposType)
|
||||
.From<TestTypeInfo, TestTypeParentInfo>((s,b,c) => s)
|
||||
|
||||
.LeftJoin(a => a.TestTypeInfoGuid == a.Type.Guid)
|
||||
.ToSql();
|
||||
|
||||
|
||||
|
||||
Func<Type, string, string> tableRule = (type, oldname) => {
|
||||
if (type == typeof(Topic)) return oldname + "AsTable1";
|
||||
else if (type == typeof(TestTypeInfo)) return oldname + "AsTable2";
|
||||
|
Reference in New Issue
Block a user