- 增加 List\<T1\> 扩展方法 IncludeMany,实现从已知的内存 List 数据,进行和 ISelect.IncludeMany 相同功能的贪婪加载;

This commit is contained in:
28810
2019-10-07 21:14:18 +08:00
parent 2b72c849d9
commit 53d4332bc5
4 changed files with 34 additions and 1 deletions

View File

@ -1155,6 +1155,8 @@ namespace FreeSql.Tests.Sqlite
g.sqlite.Insert(new Song_tag { Song_id = song3.Id, Tag_id = tag2.Id }).ExecuteAffrows();
g.sqlite.Insert(new Song_tag { Song_id = song3.Id, Tag_id = tag3.Id }).ExecuteAffrows();
new List<Song>(new[] { song1, song2, song3 }).IncludeMany(g.sqlite, a => a.Tags);
var songs1 = g.sqlite.Select<Song>()
.IncludeMany(a => a.Tags)
.Where(a => a.Id == song1.Id || a.Id == song2.Id || a.Id == song3.Id)