mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 04:18:16 +08:00
- 修复 多对多导航属性 AsSelect() 无法使用 .Count() 的问题;#362
This commit is contained in:
@ -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]
|
||||
|
@ -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]
|
||||
|
Reference in New Issue
Block a user