Skip to content

Instantly share code, notes, and snippets.

@gustavodaquino
Created May 5, 2017 18:56
Show Gist options
  • Save gustavodaquino/6aa25de67dc3aa90a2755fdbe55c97cb to your computer and use it in GitHub Desktop.
Save gustavodaquino/6aa25de67dc3aa90a2755fdbe55c97cb to your computer and use it in GitHub Desktop.
[C#] Example using Join Extension Method from LINQ.
var query = _context.TableOuter
.Join(_context.TableInner,
outer => outer.Id,
inner => inner.ForeignId,
(outer, inner) => new
{
outer,
inner
})
.Where(x => x.inner.Property == value).Select(x => x.inner).SingleOrDefault();
var result = (InnerResult)query;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment