EnumerableRowCollectionExtensions.OrderBy 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
按升序对行 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>)
根据指定的键按升序对行 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的键的类型。
参数
EnumerableRowCollection包含要排序的DataRow元素。
- keySelector
- Func<TRow,TKey>
用于从元素中提取键的函数。
返回
OrderedEnumerableRowCollection<TRow>其元素按指定键排序。
注解
此方法是使用延迟执行实现的。 即时返回值是一个对象,用于存储执行操作所需的所有信息。 除非通过直接调用对象的 GetEnumerator 方法或在 visual C# 中使用 foreach 或在 Visual Basic 中使用 For Each 来枚举对象,否则不会执行此方法表示的查询。
另请参阅
- Select<TRow,S>(EnumerableRowCollection<TRow>, Func<TRow,S>)
- ThenBy
- OrderBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IComparer<TKey>)
适用于
OrderBy<TRow,TKey>(EnumerableRowCollection<TRow>, Func<TRow,TKey>, IComparer<TKey>)
根据指定的键和比较器按升序对行 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的键的类型。
参数
EnumerableRowCollection包含要排序的DataRow元素。
- keySelector
- Func<TRow,TKey>
用于从元素中提取键的函数。
- comparer
- IComparer<TKey>
要比较键的一个 IComparer<T> 。
返回
OrderedEnumerableRowCollection<TRow>其元素按指定的键和比较器排序。
注解
此方法是使用延迟执行实现的。 即时返回值是一个对象,用于存储执行操作所需的所有信息。 除非通过直接调用对象的 GetEnumerator 方法或在 visual C# 中使用 foreach 或在 Visual Basic 中使用 For Each 来枚举对象,否则不会执行此方法表示的查询。
另请参阅
- Select<TRow,S>(EnumerableRowCollection<TRow>, Func<TRow,S>)
- ThenBy
- OrderBy<TSource,TKey>(IEnumerable<TSource>, Func<TSource,TKey>, IComparer<TKey>)