EnumerableRowCollectionExtensions.ThenBy Method

Definition

Performs a secondary ordering of the rows of a EnumerableRowCollection in ascending order.

Overloads

ThenBy<TRow,TKey>(OrderedEnumerableRowCollection<TRow>, Func<TRow,TKey>)

This API supports the product infrastructure and is not intended to be used directly from your code.

Performs a secondary ordering of the rows of a EnumerableRowCollection in ascending order according to the specified key.

ThenBy<TRow,TKey>(OrderedEnumerableRowCollection<TRow>, Func<TRow,TKey>, IComparer<TKey>)

This API supports the product infrastructure and is not intended to be used directly from your code.

Performs a secondary ordering of the rows of a EnumerableRowCollection in ascending order according to the specified key and comparer.

ThenBy<TRow,TKey>(OrderedEnumerableRowCollection<TRow>, Func<TRow,TKey>)

Performs a secondary ordering of the rows of a EnumerableRowCollection in ascending order according to the specified key.

This API supports the product infrastructure and is not intended to be used directly from your code.

public:
generic <typename TRow, typename TKey>
[System::Runtime::CompilerServices::Extension]
 static System::Data::OrderedEnumerableRowCollection<TRow> ^ ThenBy(System::Data::OrderedEnumerableRowCollection<TRow> ^ source, Func<TRow, TKey> ^ keySelector);
public static System.Data.OrderedEnumerableRowCollection<TRow> ThenBy<TRow,TKey> (this System.Data.OrderedEnumerableRowCollection<TRow> source, Func<TRow,TKey> keySelector);
static member ThenBy : System.Data.OrderedEnumerableRowCollection<'Row> * Func<'Row, 'Key> -> System.Data.OrderedEnumerableRowCollection<'Row>
<Extension()>
Public Function ThenBy(Of TRow, TKey) (source As OrderedEnumerableRowCollection(Of TRow), keySelector As Func(Of TRow, TKey)) As OrderedEnumerableRowCollection(Of TRow)

Type Parameters

TRow

The type of the row elements in source, typically DataRow.

TKey

The type of the key returned by keySelector.

Parameters

source
OrderedEnumerableRowCollection<TRow>

An EnumerableRowCollection containing the DataRow elements to be ordered.

keySelector
Func<TRow,TKey>

A function to extract a key from an element.

Returns

OrderedEnumerableRowCollection<TRow>

An OrderedEnumerableRowCollection<TRow> whose elements are sorted by the specified key.

Remarks

The use of a ThenBy operation requires an existing primary sorting operation using OrderBy.

This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in Visual C# or For Each in Visual Basic.

See also

Applies to

ThenBy<TRow,TKey>(OrderedEnumerableRowCollection<TRow>, Func<TRow,TKey>, IComparer<TKey>)

Performs a secondary ordering of the rows of a EnumerableRowCollection in ascending order according to the specified key and comparer.

This API supports the product infrastructure and is not intended to be used directly from your code.

public:
generic <typename TRow, typename TKey>
[System::Runtime::CompilerServices::Extension]
 static System::Data::OrderedEnumerableRowCollection<TRow> ^ ThenBy(System::Data::OrderedEnumerableRowCollection<TRow> ^ source, Func<TRow, TKey> ^ keySelector, System::Collections::Generic::IComparer<TKey> ^ comparer);
public static System.Data.OrderedEnumerableRowCollection<TRow> ThenBy<TRow,TKey> (this System.Data.OrderedEnumerableRowCollection<TRow> source, Func<TRow,TKey> keySelector, System.Collections.Generic.IComparer<TKey> comparer);
static member ThenBy : System.Data.OrderedEnumerableRowCollection<'Row> * Func<'Row, 'Key> * System.Collections.Generic.IComparer<'Key> -> System.Data.OrderedEnumerableRowCollection<'Row>
<Extension()>
Public Function ThenBy(Of TRow, TKey) (source As OrderedEnumerableRowCollection(Of TRow), keySelector As Func(Of TRow, TKey), comparer As IComparer(Of TKey)) As OrderedEnumerableRowCollection(Of TRow)

Type Parameters

TRow

The type of the row elements in source, typically DataRow.

TKey

The type of the key returned by keySelector.

Parameters

source
OrderedEnumerableRowCollection<TRow>

An EnumerableRowCollection containing the DataRow elements to be ordered.

keySelector
Func<TRow,TKey>

A function to extract a key from an element.

comparer
IComparer<TKey>

An IComparer<T> to compare keys.

Returns

OrderedEnumerableRowCollection<TRow>

An OrderedEnumerableRowCollection<TRow> whose elements are sorted by the specified key and comparer.

Remarks

The use of a ThenBy operation requires an existing primary sorting operation using OrderBy.

This method is implemented by using deferred execution. The immediate return value is an object that stores all the information that is required to perform the action. The query represented by this method is not executed until the object is enumerated either by calling its GetEnumerator method directly or by using foreach in Visual C# or For Each in Visual Basic.

See also

Applies to