diff --git a/Greed-Loading.md b/Greed-Loading.md index 1864910..efcb485 100644 --- a/Greed-Loading.md +++ b/Greed-Loading.md @@ -14,6 +14,9 @@ Select().Include(a => a.Parent.Parent).ToList(true); Select().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().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().IncludeMany(a => a.Songs).ToList(); + +Select().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.