mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2026-02-09 01:40:56 +08:00
update
@@ -74,6 +74,19 @@ new List<Song>(new[] { song1, song2, song3 })
|
||||
//v3.2.605+
|
||||
```
|
||||
|
||||
## Sub queryable ToList
|
||||
|
||||
> v3.2.650+
|
||||
|
||||
```csharp
|
||||
fsql.Select<Song>().ToList(a => new
|
||||
{
|
||||
all = a,
|
||||
list1 = fsql.Select<Tag>().ToList(),
|
||||
list2 = fsql.Select<SongTag>().Where(b => b.SongId == a.Id).ToList()
|
||||
});
|
||||
```
|
||||
|
||||
## Comparison of the Two Ways of IncludeMany
|
||||
|
||||
**Way 1: IncludeMany extensions**
|
||||
|
||||
15
贪婪加载.md
15
贪婪加载.md
@@ -73,7 +73,20 @@ new List<Song>(new[] { song1, song2, song3 })
|
||||
//v3.2.605+
|
||||
```
|
||||
|
||||
## 5、IncludeMany 两种方式对比
|
||||
## 5、子查询 ToList
|
||||
|
||||
> v3.2.650+ 以下最多执行3次 SQL
|
||||
|
||||
```csharp
|
||||
fsql.Select<Song>().ToList(a => new
|
||||
{
|
||||
all = a,
|
||||
list1 = fsql.Select<Tag>().ToList(),
|
||||
list2 = fsql.Select<SongTag>().Where(b => b.SongId == a.Id).ToList()
|
||||
});
|
||||
```
|
||||
|
||||
## 6、IncludeMany 两种方式对比
|
||||
|
||||
方式一(IncludeMany 扩展方法):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user