MoreEnumerableOrderedMergeTFirst, TSecond, TKey, TResult(IEnumerableTFirst, IEnumerableTSecond, FuncTFirst, TKey, FuncTSecond, TKey, FuncTFirst, TResult, FuncTSecond, TResult, FuncTFirst, TSecond, TResult, IComparerTKey) Method
Merges two heterogeneous sequences ordered by a common key type
into a homogeneous one. Additional parameters specify the
element key by which the sequences are ordered, the result when
element is found in first sequence but not in the second,
the result when element is found in second sequence but not in
the first, the result when elements are found in both sequences
and a method for comparing keys.
Namespace: MoreLinqAssembly: MoreLinq (in MoreLinq.dll) Version: 3.4.0+b99a6a8cc504caf2d48372fe54a2f8116c59cd0c
public static IEnumerable<TResult> OrderedMerge<TFirst, TSecond, TKey, TResult>(
this IEnumerable<TFirst> first,
IEnumerable<TSecond> second,
Func<TFirst, TKey> firstKeySelector,
Func<TSecond, TKey> secondKeySelector,
Func<TFirst, TResult> firstSelector,
Func<TSecond, TResult> secondSelector,
Func<TFirst, TSecond, TResult> bothSelector,
IComparer<TKey>? comparer
)
<ExtensionAttribute>
Public Shared Function OrderedMerge(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),
secondSelector As Func(Of TSecond, TResult),
bothSelector As Func(Of TFirst, TSecond, TResult),
comparer As IComparer(Of TKey)
) As IEnumerable(Of TResult)
public:
[ExtensionAttribute]
generic<typename TFirst, typename TSecond, typename TKey, typename TResult>
static IEnumerable<TResult>^ OrderedMerge(
IEnumerable<TFirst>^ first,
IEnumerable<TSecond>^ second,
Func<TFirst, TKey>^ firstKeySelector,
Func<TSecond, TKey>^ secondKeySelector,
Func<TFirst, TResult>^ firstSelector,
Func<TSecond, TResult>^ secondSelector,
Func<TFirst, TSecond, TResult>^ bothSelector,
IComparer<TKey>^ comparer
)
[<ExtensionAttribute>]
static member OrderedMerge :
first : IEnumerable<'TFirst> *
second : IEnumerable<'TSecond> *
firstKeySelector : Func<'TFirst, 'TKey> *
secondKeySelector : Func<'TSecond, 'TKey> *
firstSelector : Func<'TFirst, 'TResult> *
secondSelector : Func<'TSecond, 'TResult> *
bothSelector : Func<'TFirst, 'TSecond, 'TResult> *
comparer : IComparer<'TKey> -> IEnumerable<'TResult>
- first IEnumerableTFirst
- The first input sequence.
- second IEnumerableTSecond
- The second input sequence.
- firstKeySelector FuncTFirst, TKey
- Function to extract a key given an
element from the first sequence.
- secondKeySelector FuncTSecond, TKey
- Function to extract a key given an
element from the second sequence.
- firstSelector FuncTFirst, TResult
- Function to project the result element
when only the first sequence yields a source element.
- secondSelector FuncTSecond, TResult
- Function to project the result element
when only the second sequence yields a source element.
- bothSelector FuncTFirst, TSecond, TResult
- Function to project the result element
when only both sequences yield a source element whose keys are
equal.
- comparer IComparerTKey
- An IComparerT to compare keys.
- TFirst
- Type of elements in the first sequence.
- TSecond
- Type of elements in the second sequence.
- TKey
- Type of keys used for merging.
- TResult
- Type of elements in the returned sequence.
IEnumerableTResult
A sequence with projections from the two input sequences merged
according to a key, as in a full outer join.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).
This method uses deferred execution. The behavior is undefined
if the sequences are unordered (by key) as inputs.