mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2026-02-04 15:30:53 +08:00
update
@@ -58,7 +58,20 @@ Select<Tag>().IncludeMany(a => a.TestManys.Select(b => new TestMany { Title = b.
|
|||||||
When the main data already exists in the memory, how to load the sub-data? So we added the List\<T\> extension method, the example is as follows:
|
When the main data already exists in the memory, how to load the sub-data? So we added the List\<T\> extension method, the example is as follows:
|
||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
new List<Song>(new[] { song1, song2, song3 }).IncludeMany(fsql, a => a.Tags);
|
new List<Song>(new[] { song1, song2, song3 })
|
||||||
|
.IncludeMany(fsql, a => a.Tags);
|
||||||
|
```
|
||||||
|
|
||||||
|
```c#
|
||||||
|
new List<Song>(new[] { song1, song2, song3 })
|
||||||
|
.IncludeMany(
|
||||||
|
orm: fsql,
|
||||||
|
property: "Tags",
|
||||||
|
where: "ParentId=Code",
|
||||||
|
take: 5,
|
||||||
|
select: "id,name"
|
||||||
|
);
|
||||||
|
//v3.2.x
|
||||||
```
|
```
|
||||||
|
|
||||||
## Comparison of the Two Ways of IncludeMany
|
## Comparison of the Two Ways of IncludeMany
|
||||||
|
|||||||
15
贪婪加载.md
15
贪婪加载.md
@@ -57,7 +57,20 @@ Select<Tag>().IncludeMany(a => a.TestManys.Select(b => new TestMany { Title = b.
|
|||||||
当主数据已存在内存中,子数据怎么加载?所以我们增加了 List\<T\> 扩展方法,示例如下:
|
当主数据已存在内存中,子数据怎么加载?所以我们增加了 List\<T\> 扩展方法,示例如下:
|
||||||
|
|
||||||
```csharp
|
```csharp
|
||||||
new List<Song>(new[] { song1, song2, song3 }).IncludeMany(fsql, a => a.Tags);
|
new List<Song>(new[] { song1, song2, song3 })
|
||||||
|
.IncludeMany(fsql, a => a.Tags);
|
||||||
|
```
|
||||||
|
|
||||||
|
```c#
|
||||||
|
new List<Song>(new[] { song1, song2, song3 })
|
||||||
|
.IncludeMany(
|
||||||
|
orm: fsql,
|
||||||
|
property: "Tags",
|
||||||
|
where: "ParentId=Code",
|
||||||
|
take: 5,
|
||||||
|
select: "id,name"
|
||||||
|
);
|
||||||
|
//v3.2.x
|
||||||
```
|
```
|
||||||
|
|
||||||
## 5、IncludeMany 两种方式对比
|
## 5、IncludeMany 两种方式对比
|
||||||
|
|||||||
Reference in New Issue
Block a user