- 修复 多对多导航属性 AsSelect() 无法使用 .Count() 的问题;#362

This commit is contained in:
28810
2020-07-06 16:10:36 +08:00
parent 1caaba4005
commit bc77869cf7
4 changed files with 49 additions and 9 deletions

View File

@ -111,6 +111,12 @@ namespace FreeSql.Tests.SqlServer
// WHERE(t.[Name] = '国语') AND(t.[Id] = Mt_Ms.[Tag_id])
// limit 0, 1))
// limit 0, 1))
var t3 = g.sqlserver.Select<Song>().ToList(r => new
{
r.Title,
count = r.Tags.AsSelect().Count()
});
}
[Fact]

View File

@ -107,6 +107,17 @@ namespace FreeSql.Tests.Sqlite
// WHERE(t.`Name` = '国语') AND(t.`Id` = Mt_Ms.`Tag_id`)
// limit 0, 1))
// limit 0, 1))
var t3 = g.sqlite.Select<Song>().ToList(r => new
{
r.Title,
count = r.Tags.AsSelect().Count(),
//sum = r.Tags.AsSelect().Sum(b => b.Id + 0),
//avg = r.Tags.AsSelect().Avg(b => b.Id + 1),
//max = r.Tags.AsSelect().Max(b => b.Id + 2),
//min = r.Tags.AsSelect().Min(b => b.Id + 3),
//first = r.Tags.AsSelect().First(b => b.Name)
});
}
[Fact]