EnumerableRowCollectionExtensions.ThenByDescending Method

Definition

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

Overloads

ThenByDescending<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 descending order according to the specified key.

ThenByDescending<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 descending order according to the specified key and comparer.

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

Source:
EnumerableRowCollectionExtensions.cs
Source:
EnumerableRowCollectionExtensions.cs
Source:
EnumerableRowCollectionExtensions.cs

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

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

C#
public static System.Data.OrderedEnumerableRowCollection<TRow> ThenByDescending<TRow,TKey> (this System.Data.OrderedEnumerableRowCollection<TRow> source, Func<TRow,TKey> keySelector);

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

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

Remarks

The use of a ThenByDescending 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

.NET 9 and other versions
Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1

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

Source:
EnumerableRowCollectionExtensions.cs
Source:
EnumerableRowCollectionExtensions.cs
Source:
EnumerableRowCollectionExtensions.cs

Performs a secondary ordering of the rows of a EnumerableRowCollection in descending 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.

C#
public static System.Data.OrderedEnumerableRowCollection<TRow> ThenByDescending<TRow,TKey> (this System.Data.OrderedEnumerableRowCollection<TRow> source, Func<TRow,TKey> keySelector, System.Collections.Generic.IComparer<TKey> comparer);

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

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

Remarks

The use of a ThenByDescending 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

.NET 9 and other versions
Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided), 2.1