EnumerableRowCollectionExtensions.ThenBy 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
對 的 EnumerableRowCollection 列進行次級排序,從高到低。
多載
| 名稱 | Description |
|---|---|
| ThenBy<TRow,TKey>(OrderedEnumerableRowCollection<TRow>, Func<TRow,TKey>) |
此 API 支援此產品基礎結構,但無法直接用於程式碼之中。 依照指定的鍵,對 的 EnumerableRowCollection 列進行次級排序,從高到低。 |
| ThenBy<TRow,TKey>(OrderedEnumerableRowCollection<TRow>, Func<TRow,TKey>, IComparer<TKey>) |
此 API 支援此產品基礎結構,但無法直接用於程式碼之中。 依照指定的鍵與比較器,對 a 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待排序元素的 an 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>)
依照指定的鍵與比較器,對 a 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待排序元素的 an 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>)