groupJoinE<TInner, TKey, TResult> method

Enumerable<TResult> groupJoinE <TInner, TKey, TResult>(Iterable<TInner> inner, Selector<T, TKey> outerKeySelector, Selector<TInner, TKey> innerKeySelector, GroupSelector<T, Iterable<TInner>, TResult> resultSelector, { EqualityComparer<TKey> keyComparer })

Joins elements in the enumerable with a group of all elements in the inner collection that match the generated key.

First, groupJoinE will iterate over the other collection and make a lookup table of its elements, referenceable by a key generated by innerKeySelector. Then groupJoinE will iterate over the source enumeration, generating keys via the outerKeySelector. If a generated outer key matches an inner key in the collection lookup, the enumerable element is passed to the selector with all elements from the other collection that match that key. The returned value of selector is then added to the resulting enumerable.

Elements in the source enumerable that doesn't share a key in the lookup table are passed to the selector function with an empty collection as the second parameter. Elements in other that don't share a key with a source enumerable element are discarded.

groupJoinE is different from joinE in that, where joinE will produce a new resulting element for each key match between the source enumerable and the inner collection, groupJoinE will produce a new element from an element in the source enumerable and all elements in the inner collection that match on the key.

Implementation

Enumerable<TResult> groupJoinE<TInner, TKey, TResult>(
    Iterable<TInner> inner,
    Selector<T, TKey> outerKeySelector,
    Selector<TInner, TKey> innerKeySelector,
    GroupSelector<T, Iterable<TInner>, TResult> resultSelector,
    {EqualityComparer<TKey> keyComparer}) {
  assert(inner != null &&
      outerKeySelector != null &&
      innerKeySelector != null &&
      resultSelector != null);
  return GroupJoinEnumerable<T, TInner, TKey, TResult>(this, inner,
      outerKeySelector, innerKeySelector, resultSelector, keyComparer);
}