Created
June 7, 2019 10:59
-
-
Save jmrnilsson/73b02af88162af09d5718d83a75234c6 to your computer and use it in GitHub Desktop.
Example: Outer join and group join examples in C# FLWR and "method chaining "
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var q = | |
from iu in Items | |
join u in OtherItems on iu.Id equals u.Id into ug | |
from u in ug.DefaultIfEmpty() | |
where u == null | |
orderby iu.Id | |
select iu; | |
var q1 = | |
Items | |
.GroupJoin(OtherItems, iu => iu.Id, u => u.Id, (iu, u) => new {iu, u}) | |
.Where(a => !a.u.Any()) | |
.OrderBy(a => a.iu.Id) | |
.Select(a => a.iu); | |
q.Take(3).Dump("_0"); | |
q1.Take(3).Dump("_1"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment