mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 04:18:16 +08:00
- 优化 IncludeMany 筛选字段中未指定主键,并且 then.IncludeMany 继续向下,则自动附加查询主键;
This commit is contained in:
@ -1648,6 +1648,12 @@ WHERE (((cast(a.""Id"" as character)) in (SELECT b.""Title""
|
||||
Assert.Equal(1, songs22[1].Tags.Count);
|
||||
Assert.Equal(1, songs22[2].Tags.Count);
|
||||
|
||||
var asongs222211 = g.sqlite.Select<Song>()
|
||||
.IncludeMany(a => a.Tags.Take(1).Select(b => new Tag { Name = b.Name }),
|
||||
then => then.IncludeMany(t => t.Songs.Take(1).Select(b => new Song { Id = b.Id, Title = b.Title })))
|
||||
.Where(a => a.Id == song1.Id || a.Id == song2.Id || a.Id == song3.Id)
|
||||
.ToList();
|
||||
|
||||
var atags33 = g.sqlite.Select<Song_tag>()
|
||||
.Include(a => a.Tag.Parent)
|
||||
.IncludeMany(a => a.Tag.Songs.Take(1).Select(b => new Song { Id = b.Id, Title = b.Title }))
|
||||
|
Reference in New Issue
Block a user