EnumerableRowCollectionExtensions.OrderBy 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
依照升序排序 a EnumerableRowCollection 的列。
多載
| 名稱 | Description |
|---|---|
| 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待排序元素的 an 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待排序元素的 an 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>)