XEnumerableLeftOuterJoinTLeft, TRight, TKey, TResult Method |
Produces the left outer join of two sequences.
Namespace:
Linq.Extras
Assembly:
Linq.Extras (in Linq.Extras.dll) Version: 5.0.0+96a4f4bfed64095342c5df107c1fe1fb95603ee5
Syntaxpublic static IEnumerable<TResult> LeftOuterJoin<TLeft, TRight, TKey, TResult>(
this IEnumerable<TLeft> left,
IEnumerable<TRight> right,
Func<TLeft, TKey> leftKeySelector,
Func<TRight, TKey> rightKeySelector,
Func<TLeft, TRight, TResult> resultSelector,
TRight defaultRight = null,
IEqualityComparer<TKey>? keyComparer = null
)
<ExtensionAttribute>
Public Shared Function LeftOuterJoin(Of TLeft, TRight, TKey, TResult) (
left As IEnumerable(Of TLeft),
right As IEnumerable(Of TRight),
leftKeySelector As Func(Of TLeft, TKey),
rightKeySelector As Func(Of TRight, TKey),
resultSelector As Func(Of TLeft, TRight, TResult),
Optional defaultRight As TRight = Nothing,
Optional keyComparer As IEqualityComparer(Of TKey) = Nothing
) As IEnumerable(Of TResult)
[<ExtensionAttribute>]
static member LeftOuterJoin :
left : IEnumerable<'TLeft> *
right : IEnumerable<'TRight> *
leftKeySelector : Func<'TLeft, 'TKey> *
rightKeySelector : Func<'TRight, 'TKey> *
resultSelector : Func<'TLeft, 'TRight, 'TResult> *
?defaultRight : 'TRight *
?keyComparer : IEqualityComparer<'TKey>
(* Defaults:
let _defaultRight = defaultArg defaultRight null
let _keyComparer = defaultArg keyComparer null
*)
-> IEnumerable<'TResult>
Parameters
- left
- Type: System.Collections.GenericIEnumerableTLeft
The left sequence. - right
- Type: System.Collections.GenericIEnumerableTRight
The right sequence. - leftKeySelector
- Type: SystemFuncTLeft, TKey
The key selector for elements of the left sequence. - rightKeySelector
- Type: SystemFuncTRight, TKey
The key selector for elements of the right sequence. - resultSelector
- Type: SystemFuncTLeft, TRight, TResult
A function to produce an output element from two matching elements from the left and right sequences. - defaultRight (Optional)
- Type: TRight
The default value to use for missing elements in right. - keyComparer (Optional)
- Type: System.Collections.GenericIEqualityComparerTKey
A comparer to test for equality between the keys.
Type Parameters
- TLeft
- The type of the elements of left.
- TRight
- The type of the elements of right.
- TKey
- The type of the key used to join elements.
- TResult
- The type of the elements of the output sequence
Return Value
Type:
IEnumerableTResultThe left outer join of
left and
right.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerableTLeft. 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