Created
May 25, 2016 01:11
-
-
Save paggiogriot/87036a128c60a8bb4c94fc66e80c1e9e to your computer and use it in GitHub Desktop.
How do you perform a left outer join using linq extension methods
This file contains hidden or 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 qry = Foo.GroupJoin( | |
Bar, | |
foo => foo.Foo_Id, | |
bar => bar.Foo_Id, | |
(x,y) => new { Foo = x, Bars = y }) | |
.SelectMany( | |
x => x.Bars.DefaultIfEmpty(), | |
(x,y) => new { Foo=x.Foo, Bar=y}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment