Επεξεργασία

Κοινή χρήση μέσω


TypedTableBaseExtensions.OrderBy Method

Definition

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

Overloads

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

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

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

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

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

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

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

public:
generic <typename TRow, typename TKey>
 where TRow : System::Data::DataRow[System::Runtime::CompilerServices::Extension]
 static System::Data::OrderedEnumerableRowCollection<TRow> ^ OrderBy(System::Data::TypedTableBase<TRow> ^ source, Func<TRow, TKey> ^ keySelector);
public static System.Data.OrderedEnumerableRowCollection<TRow> OrderBy<TRow,TKey> (this System.Data.TypedTableBase<TRow> source, Func<TRow,TKey> keySelector) where TRow : System.Data.DataRow;
static member OrderBy : System.Data.TypedTableBase<'Row (requires 'Row :> System.Data.DataRow)> * Func<'Row, 'Key (requires 'Row :> System.Data.DataRow)> -> System.Data.OrderedEnumerableRowCollection<'Row (requires 'Row :> System.Data.DataRow)> (requires 'Row :> System.Data.DataRow)
<Extension()>
Public Function OrderBy(Of TRow As DataRow, TKey As DataRow) (source As TypedTableBase(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
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

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

public:
generic <typename TRow, typename TKey>
 where TRow : System::Data::DataRow[System::Runtime::CompilerServices::Extension]
 static System::Data::OrderedEnumerableRowCollection<TRow> ^ OrderBy(System::Data::TypedTableBase<TRow> ^ source, Func<TRow, TKey> ^ keySelector, System::Collections::Generic::IComparer<TKey> ^ comparer);
public static System.Data.OrderedEnumerableRowCollection<TRow> OrderBy<TRow,TKey> (this System.Data.TypedTableBase<TRow> source, Func<TRow,TKey> keySelector, System.Collections.Generic.IComparer<TKey> comparer) where TRow : System.Data.DataRow;
static member OrderBy : System.Data.TypedTableBase<'Row (requires 'Row :> System.Data.DataRow)> * Func<'Row, 'Key (requires 'Row :> System.Data.DataRow)> * System.Collections.Generic.IComparer<'Key> -> System.Data.OrderedEnumerableRowCollection<'Row (requires 'Row :> System.Data.DataRow)> (requires 'Row :> System.Data.DataRow)
<Extension()>
Public Function OrderBy(Of TRow As DataRow, TKey As DataRow) (source As TypedTableBase(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
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