TypedTableBaseExtensions.OrderByDescending Method

Definition

Sorts the rows of a TypedTableBase<T> in descending order.

Overloads

OrderByDescending<TRow,TKey>(TypedTableBase<TRow>, Func<TRow,TKey>)

Sorts the rows of a TypedTableBase<T> in descending order according to the specified key.

OrderByDescending<TRow,TKey>(TypedTableBase<TRow>, Func<TRow,TKey>, IComparer<TKey>)

Sorts the rows of a TypedTableBase<T> in descending order according to the specified key and comparer.

OrderByDescending<TRow,TKey>(TypedTableBase<TRow>, Func<TRow,TKey>)

Source:
TypedTableBaseExtensions.cs
Source:
TypedTableBaseExtensions.cs
Source:
TypedTableBaseExtensions.cs

Sorts the rows of a TypedTableBase<T> in descending order according to the specified key.

C#
public static System.Data.OrderedEnumerableRowCollection<TRow> OrderByDescending<TRow,TKey>(this System.Data.TypedTableBase<TRow> source, Func<TRow,TKey> keySelector) where TRow : System.Data.DataRow;

Type Parameters

TRow

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

TKey

The type of the key returned by keySelector.

Parameters

source
TypedTableBase<TRow>

A TypedTableBase<T> that contains 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.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.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

OrderByDescending<TRow,TKey>(TypedTableBase<TRow>, Func<TRow,TKey>, IComparer<TKey>)

Source:
TypedTableBaseExtensions.cs
Source:
TypedTableBaseExtensions.cs
Source:
TypedTableBaseExtensions.cs

Sorts the rows of a TypedTableBase<T> in descending order according to the specified key and comparer.

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

Type Parameters

TRow

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

TKey

The type of the key returned by keySelector.

Parameters

source
TypedTableBase<TRow>

A TypedTableBase<T> that contains 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.

Applies to

.NET 10 and other versions
Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.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