TEnumerable.OrderByDescending<T,TKey> Method

Overloads

OrderByDescending<T,TKey>(IEnumerable<T>, Func<T,TKey>)

Sorts the elements of a sequence in descending order according to a key.

OrderByDescending<T,TKey>(IEnumerable<T>, Func<T,TKey>, IComparer<TKey>)

Sorts the elements of a sequence in descending order by using a specified comparer.

OrderByDescending<T,TKey>(IEnumerable<T>, Func<T,TKey>)

Sorts the elements of a sequence in descending order according to a key.

Delphi
class function OrderByDescending<T,TKey>(const source: IEnumerable<T>; const keySelector: Func<T, TKey>): IEnumerable<T>

Type Parameters

T

The type of the elements of source .

TKey

The type of the key returned by keySelector .

Parameters

source
IEnumerable<T>

A sequence of values to order.

keySelector
Func<T, TKey>

A function to extract a key from an element.

Returns

IEnumerable<T>

A sequence whose elements are sorted in descending order according to a key.

Exceptions

source or keySelector is nil .

OrderByDescending<T,TKey>(IEnumerable<T>, Func<T,TKey>, IComparer<TKey>)

Sorts the elements of a sequence in descending order by using a specified comparer.

Delphi
class function OrderByDescending<T,TKey>(const source: IEnumerable<T>; const keySelector: Func<T, TKey>; const comparer: IComparer<TKey>): IEnumerable<T>

Type Parameters

T

The type of the elements of source .

TKey

The type of the key returned by keySelector .

Parameters

source
IEnumerable<T>

A sequence of values to order.

keySelector
Func<T, TKey>

A function to extract a key from an element.

comparer
IComparer<TKey>

A comparer to compare keys.

Returns

IEnumerable<T>

A sequence whose elements are sorted in descending order according to a key.

Exceptions

source or keySelector or comparer is nil .