Updated Greed Loading (markdown)

2881099
2025-05-07 12:27:46 +08:00
parent f5bf6e5878
commit 3e3049d999

@@ -14,6 +14,9 @@ Select<Tag>().Include(a => a.Parent.Parent).ToList(true);
Select<Tag>().Where(a => a.Parent.Parent.Name == "1").ToList(true);
//Write in this way, no need to mark Join,
//it will be automatically processed into LeftJoin when parsing the expression
Select<Tag>().LeftJoin(a => a.Parent.Id == a.ParentId && a.Parent.xxx > 0).ToList();
//Write this way to add filtering conditions to ManyToOne
```
## Navigation Properties - OneToMany/ManyToMany
@@ -22,6 +25,9 @@ IncludeMany greedily loads the navigation properties of the collection. In fact,
```csharp
Select<Tag>().IncludeMany(a => a.Songs).ToList();
Select<Tag>().IncludeMany(a => a.Songs, then => then.Where(song => song.xxx > 0)).ToList();
//Write this way to add filtering conditions to OneToMany/ManyToMany
```
IncludeMany has a second parameter, which can be modified before the second query.