MoreEnumerableSortedMergeTSource(IEnumerableTSource, OrderByDirection, IComparerTSource, IEnumerableTSource) Method

Merges two or more sequences that are in a common order (either ascending or descending) into a single sequence that preserves that order.

Definition

Namespace: MoreLinq
Assembly: MoreLinq (in MoreLinq.dll) Version: 4.1.0+0e154ef592f33ce0f6f3d534a9eedee273f0ce72
C#
public static IEnumerable<TSource> SortedMerge<TSource>(
	this IEnumerable<TSource> source,
	OrderByDirection direction,
	IComparer<TSource>? comparer,
	params IEnumerable<TSource>[] otherSequences
)

Parameters

source  IEnumerableTSource
The primary sequence with which to merge.
direction  OrderByDirection
The ordering that all sequences must already exhibit.
comparer  IComparerTSource
The comparer used to evaluate the relative order between elements.
otherSequences  IEnumerableTSource
A variable argument array of zero or more other sequences to merge with.

Type Parameters

TSource
The type of the elements in the sequence.

Return Value

IEnumerableTSource
A merged, order-preserving sequence containing al of the elements of the original sequences.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerableTSource. 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