Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>According to <a href="http://codeblog.jonskeet.uk/category/edulinq/" rel="noreferrer">eduLINQ</a>:</p> <blockquote> <p>The best way to get to grips with what GroupJoin does is to think of Join. There, the overall idea was that we looked through the "outer" input sequence, found all the matching items from the "inner" sequence (based on a key projection on each sequence) and then yielded pairs of matching elements. <strong>GroupJoin is similar, except that instead of yielding pairs of elements, it yields a single result for each "outer" item based on that item and the sequence of matching "inner" items</strong>.</p> </blockquote> <p>The only difference is in return statement:</p> <p><strong>Join</strong>:</p> <pre><code>var lookup = inner.ToLookup(innerKeySelector, comparer); foreach (var outerElement in outer) { var key = outerKeySelector(outerElement); foreach (var innerElement in lookup[key]) { yield return resultSelector(outerElement, innerElement); } } </code></pre> <p><strong>GroupJoin</strong>:</p> <pre><code>var lookup = inner.ToLookup(innerKeySelector, comparer); foreach (var outerElement in outer) { var key = outerKeySelector(outerElement); yield return resultSelector(outerElement, lookup[key]); } </code></pre> <p>Read more here:</p> <ul> <li><p><a href="http://codeblog.jonskeet.uk/2010/12/31/reimplementing-linq-to-objects-part-19-join/" rel="noreferrer">Reimplementing LINQ to Objects: Part 19 - Join</a></p></li> <li><p><a href="http://codeblog.jonskeet.uk/2011/01/01/reimplementing-linq-to-objects-part-22-groupjoin/" rel="noreferrer">Reimplementing LINQ to Objects: Part 22 - GroupJoin</a></p></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload