EnumerableRowCollectionExtensions.ThenBy 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
按升序对行 EnumerableRowCollection 执行次要排序。
重载
| 名称 | 说明 |
|---|---|
| ThenBy<TRow,TKey>(OrderedEnumerableRowCollection<TRow>, Func<TRow,TKey>) |
此 API 支持产品基础结构,不能在代码中直接使用。 根据指定的键按升序对行 EnumerableRowCollection 执行辅助排序。 |
| ThenBy<TRow,TKey>(OrderedEnumerableRowCollection<TRow>, Func<TRow,TKey>, IComparer<TKey>) |
此 API 支持产品基础结构,不能在代码中直接使用。 根据指定的键和比较器按升序对行执行次序排序 EnumerableRowCollection 。 |
ThenBy<TRow,TKey>(OrderedEnumerableRowCollection<TRow>, Func<TRow,TKey>)
根据指定的键按升序对行 EnumerableRowCollection 执行辅助排序。
此 API 支持产品基础结构,不能在代码中直接使用。
public:
generic <typename TRow, typename TKey>
[System::Runtime::CompilerServices::Extension]
static System::Data::OrderedEnumerableRowCollection<TRow> ^ ThenBy(System::Data::OrderedEnumerableRowCollection<TRow> ^ source, Func<TRow, TKey> ^ keySelector);
public static System.Data.OrderedEnumerableRowCollection<TRow> ThenBy<TRow,TKey>(this System.Data.OrderedEnumerableRowCollection<TRow> source, Func<TRow,TKey> keySelector);
static member ThenBy : System.Data.OrderedEnumerableRowCollection<'Row> * Func<'Row, 'Key> -> System.Data.OrderedEnumerableRowCollection<'Row>
<Extension()>
Public Function ThenBy(Of TRow, TKey) (source As OrderedEnumerableRowCollection(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>其元素按指定键排序。
注解
操作的使用 ThenBy 需要使用现有的主排序操作 OrderBy。
此方法是使用延迟执行实现的。 即时返回值是一个对象,用于存储执行操作所需的所有信息。 除非通过直接调用对象的 GetEnumerator 方法或在 visual C# 中使用 foreach 或在 Visual Basic 中使用 For Each 来枚举对象,否则不会执行此方法表示的查询。
另请参阅
- Select<TRow,S>(EnumerableRowCollection<TRow>, Func<TRow,S>)
- OrderBy
- ThenBy<TSource,TKey>(IOrderedEnumerable<TSource>, Func<TSource,TKey>)
适用于
ThenBy<TRow,TKey>(OrderedEnumerableRowCollection<TRow>, Func<TRow,TKey>, IComparer<TKey>)
根据指定的键和比较器按升序对行执行次序排序 EnumerableRowCollection 。
此 API 支持产品基础结构,不能在代码中直接使用。
public:
generic <typename TRow, typename TKey>
[System::Runtime::CompilerServices::Extension]
static System::Data::OrderedEnumerableRowCollection<TRow> ^ ThenBy(System::Data::OrderedEnumerableRowCollection<TRow> ^ source, Func<TRow, TKey> ^ keySelector, System::Collections::Generic::IComparer<TKey> ^ comparer);
public static System.Data.OrderedEnumerableRowCollection<TRow> ThenBy<TRow,TKey>(this System.Data.OrderedEnumerableRowCollection<TRow> source, Func<TRow,TKey> keySelector, System.Collections.Generic.IComparer<TKey> comparer);
static member ThenBy : System.Data.OrderedEnumerableRowCollection<'Row> * Func<'Row, 'Key> * System.Collections.Generic.IComparer<'Key> -> System.Data.OrderedEnumerableRowCollection<'Row>
<Extension()>
Public Function ThenBy(Of TRow, TKey) (source As OrderedEnumerableRowCollection(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>其元素按指定的键和比较器排序。
注解
操作的使用 ThenBy 需要使用现有的主排序操作 OrderBy。
此方法是使用延迟执行实现的。 即时返回值是一个对象,用于存储执行操作所需的所有信息。 除非通过直接调用对象的 GetEnumerator 方法或在 visual C# 中使用 foreach 或在 Visual Basic 中使用 For Each 来枚举对象,否则不会执行此方法表示的查询。
另请参阅
- Select<TRow,S>(EnumerableRowCollection<TRow>, Func<TRow,S>)
- OrderBy
- ThenBy<TSource,TKey>(IOrderedEnumerable<TSource>, Func<TSource,TKey>, IComparer<TKey>)