MoreEnumerableLeftJoinTFirst, TSecond, TKey, TResult Method (IEnumerableTFirst, IEnumerableTSecond, FuncTFirst, TKey, FuncTSecond, TKey, FuncTFirst, TResult, FuncTFirst, TSecond, TResult) |
Performs a left outer join on two heterogeneous sequences.
Additional arguments specify key selection functions and result
projection functions.
Namespace:
MoreLinq
Assembly:
MoreLinq (in MoreLinq.dll) Version: 2.8.0
Syntax public static IEnumerable<TResult> LeftJoin<TFirst, TSecond, TKey, TResult>(
this IEnumerable<TFirst> first,
IEnumerable<TSecond> second,
Func<TFirst, TKey> firstKeySelector,
Func<TSecond, TKey> secondKeySelector,
Func<TFirst, TResult> firstSelector,
Func<TFirst, TSecond, TResult> bothSelector
)
<ExtensionAttribute>
Public Shared Function LeftJoin(Of TFirst, TSecond, TKey, TResult) (
first As IEnumerable(Of TFirst),
second As IEnumerable(Of TSecond),
firstKeySelector As Func(Of TFirst, TKey),
secondKeySelector As Func(Of TSecond, TKey),
firstSelector As Func(Of TFirst, TResult),
bothSelector As Func(Of TFirst, TSecond, TResult)
) As IEnumerable(Of TResult)
public:
[ExtensionAttribute]
generic<typename TFirst, typename TSecond, typename TKey, typename TResult>
static IEnumerable<TResult>^ LeftJoin(
IEnumerable<TFirst>^ first,
IEnumerable<TSecond>^ second,
Func<TFirst, TKey>^ firstKeySelector,
Func<TSecond, TKey>^ secondKeySelector,
Func<TFirst, TResult>^ firstSelector,
Func<TFirst, TSecond, TResult>^ bothSelector
)
[<ExtensionAttribute>]
static member LeftJoin :
first : IEnumerable<'TFirst> *
second : IEnumerable<'TSecond> *
firstKeySelector : Func<'TFirst, 'TKey> *
secondKeySelector : Func<'TSecond, 'TKey> *
firstSelector : Func<'TFirst, 'TResult> *
bothSelector : Func<'TFirst, 'TSecond, 'TResult> -> IEnumerable<'TResult>
Parameters
- first
- Type: System.Collections.GenericIEnumerableTFirst
The first sequence of the join operation. - second
- Type: System.Collections.GenericIEnumerableTSecond
The second sequence of the join operation. - firstKeySelector
- Type: SystemFuncTFirst, TKey
Function that projects the key given an element from first. - secondKeySelector
- Type: SystemFuncTSecond, TKey
Function that projects the key given an element from second. - firstSelector
- Type: SystemFuncTFirst, TResult
Function that projects the result given just an element from
first where there is no corresponding element
in second. - bothSelector
- Type: SystemFuncTFirst, TSecond, TResult
Function that projects the result given an element from
first and an element from second
that match on a common key.
Type Parameters
- TFirst
-
The type of elements in the first sequence.
- TSecond
-
The type of elements in the second sequence.
- TKey
-
The type of the key returned by the key selector functions.
- TResult
-
The type of the result elements.
Return Value
Type:
IEnumerableTResultA sequence containing results projected from a left
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
IEnumerableTFirst. 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