EnumerableRowCollectionExtensions.OrderBy 方法

定义

按升序排序 EnumerableRowCollection 的行。

重载

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

此 API 支持产品基础结构,不能在代码中直接使用。

按指定键升序排序 EnumerableRowCollection 的行。

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

此 API 支持产品基础结构,不能在代码中直接使用。

按指定键和比较器升序排序 EnumerableRowCollection 的行。

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

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

按指定键升序排序 EnumerableRowCollection 的行。

此 API 支持产品基础结构,不能在代码中直接使用。

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)

类型参数

TRow

source 中行元素的类型,通常为 DataRow

TKey

keySelector 返回的键的类型。

参数

source
EnumerableRowCollection<TRow>

包含要排序的 EnumerableRowCollection 元素的 DataRow

keySelector
Func<TRow,TKey>

用于从元素中提取键的函数。

返回

一个 OrderedEnumerableRowCollection<TRow>,其元素按指定键排序。

注解

此方法通过使用延迟执行来实现。 即时返回值是一个对象,用于存储执行操作所需的所有信息。 在通过直接调用GetEnumerator对象的方法或在 Visual C# For Eachforeach Visual Basic 中使用 来枚举对象之前,不会执行此方法表示的查询。

另请参阅

适用于

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

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

按指定键和比较器升序排序 EnumerableRowCollection 的行。

此 API 支持产品基础结构,不能在代码中直接使用。

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)

类型参数

TRow

source 中行元素的类型,通常为 DataRow

TKey

keySelector 返回的键的类型。

参数

source
EnumerableRowCollection<TRow>

包含要排序的 EnumerableRowCollection 元素的 DataRow

keySelector
Func<TRow,TKey>

用于从元素中提取键的函数。

comparer
IComparer<TKey>

用于比较键的 IComparer<T>

返回

一个 OrderedEnumerableRowCollection<TRow>,其元素按指定键和比较器排序。

注解

此方法通过使用延迟执行来实现。 即时返回值是一个对象,用于存储执行操作所需的所有信息。 在通过直接调用GetEnumerator对象的方法或在 Visual C# For Eachforeach Visual Basic 中使用 来枚举对象之前,不会执行此方法表示的查询。

另请参阅

适用于