TypedTableBaseExtensions.OrderByDescending<TRow, TKey> Method (TypedTableBase<TRow>, Func<TRow, TKey>, IComparer<TKey>)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

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

Namespace:   System.Data
Assembly:  System.Data.DataSetExtensions (in System.Data.DataSetExtensions.dll)

public static OrderedEnumerableRowCollection<TRow> OrderByDescending<TRow, TKey>(
	this TypedTableBase<TRow> source,
	Func<TRow, TKey> keySelector,
	IComparer<TKey> comparer
)
where TRow : DataRow

Parameters

source
Type: System.Data.TypedTableBase<TRow>

A TypedTableBase<T> that contains the DataRow elements to be ordered.

keySelector
Type: System.Func<TRow, TKey>

A function to extract a key from an element.

comparer
Type: System.Collections.Generic.IComparer<TKey>

An IComparer<T> to compare keys.

Return Value

Type: System.Data.OrderedEnumerableRowCollection<TRow>

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

Type Parameters

TRow

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

TKey

The type of the key returned by keySelector.

.NET Framework
Available since 3.5
Return to top
Show: