MoreEnumerable.FullJoin<TSource, TKey, TResult>(IEnumerable<TSource>, IEnumerable<TSource>, Func<TSource, TKey>, Func<TSource, TResult>, Func<TSource, TResult>, Func<TSource, TSource, TResult>, IEqualityComparer<TKey>) Method

Performs a full outer join on two homogeneous sequences. Additional arguments specify key selection functions, result projection functions and a key comparer.

Definition

Namespace: MoreLinq
Assembly: MoreLinq (in MoreLinq.dll) Version: 4.1.0+0e154ef592f33ce0f6f3d534a9eedee273f0ce72
C#
public static IEnumerable<TResult> FullJoin<TSource, TKey, TResult>(
	this IEnumerable<TSource> first,
	IEnumerable<TSource> second,
	Func<TSource, TKey> keySelector,
	Func<TSource, TResult> firstSelector,
	Func<TSource, TResult> secondSelector,
	Func<TSource, TSource, TResult> bothSelector,
	IEqualityComparer<TKey>? comparer
)

Parameters

first  IEnumerable<TSource>
The first sequence to join fully.
second  IEnumerable<TSource>
The second sequence to join fully.
keySelector  Func<TSource, TKey>
Function that projects the key given an element of one of the sequences to join.
firstSelector  Func<TSource, TResult>
Function that projects the result given just an element from first where there is no corresponding element in second.
secondSelector  Func<TSource, TResult>
Function that projects the result given just an element from second where there is no corresponding element in first.
bothSelector  Func<TSource, TSource, TResult>
Function that projects the result given an element from first and an element from second that match on a common key.
comparer  IEqualityComparer<TKey>
The IEqualityComparer<T> instance used to compare keys for equality.

Type Parameters

TSource
The type of elements in the source sequence.
TKey
The type of the key returned by the key selector function.
TResult
The type of the result elements.

Return Value

IEnumerable<TResult>
A sequence containing results projected from a full outer join of the two input sequences.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable<TSource>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also