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: 3.4.0+b99a6a8cc504caf2d48372fe54a2f8116c59cd0c
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