Redigera

Dela via


EnumerableRowCollectionExtensions.OrderBy Method

Definition

Sorts the rows of a EnumerableRowCollection in ascending order.

Overloads

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

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

Sorts the rows of a EnumerableRowCollection in ascending order according to the specified key.

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

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

Sorts the rows of a EnumerableRowCollection in ascending order according to the specified key and comparer.

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

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

Sorts the rows of a EnumerableRowCollection in ascending order according to the specified key.

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

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

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

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

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

Sorts the rows of a EnumerableRowCollection in ascending 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.

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

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