EnumerableRowCollectionExtensions.ThenByDescending 方法

定義

依遞減順序,執行 EnumerableRowCollection 中資料列的次要排序作業。

多載

ThenByDescending<TRow,TKey>(OrderedEnumerableRowCollection<TRow>, Func<TRow,TKey>)

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

依據指定的索引鍵,按遞減順序執行 EnumerableRowCollection 中資料列的次要排序作業。

ThenByDescending<TRow,TKey>(OrderedEnumerableRowCollection<TRow>, Func<TRow,TKey>, IComparer<TKey>)

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

依據指定的索引鍵和比較子,按遞減順序執行 EnumerableRowCollection 中資料列的次要排序作業。

ThenByDescending<TRow,TKey>(OrderedEnumerableRowCollection<TRow>, Func<TRow,TKey>)

來源:
EnumerableRowCollectionExtensions.cs
來源:
EnumerableRowCollectionExtensions.cs
來源:
EnumerableRowCollectionExtensions.cs

依據指定的索引鍵,按遞減順序執行 EnumerableRowCollection 中資料列的次要排序作業。

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

public:
generic <typename TRow, typename TKey>
[System::Runtime::CompilerServices::Extension]
 static System::Data::OrderedEnumerableRowCollection<TRow> ^ ThenByDescending(System::Data::OrderedEnumerableRowCollection<TRow> ^ source, Func<TRow, TKey> ^ keySelector);
public static System.Data.OrderedEnumerableRowCollection<TRow> ThenByDescending<TRow,TKey> (this System.Data.OrderedEnumerableRowCollection<TRow> source, Func<TRow,TKey> keySelector);
static member ThenByDescending : System.Data.OrderedEnumerableRowCollection<'Row> * Func<'Row, 'Key> -> System.Data.OrderedEnumerableRowCollection<'Row>
<Extension()>
Public Function ThenByDescending(Of TRow, TKey) (source As OrderedEnumerableRowCollection(Of TRow), keySelector As Func(Of TRow, TKey)) As OrderedEnumerableRowCollection(Of TRow)

類型參數

TRow

source 中資料列項目的型別,通常是 DataRow

TKey

keySelector 所傳回之索引鍵的型別。

參數

keySelector
Func<TRow,TKey>

用來從項目擷取索引鍵的函式。

傳回

OrderedEnumerableRowCollection<TRow>,其項目排序依據是指定的索引鍵。

備註

使用 ThenByDescending 作業需要使用 現有的主要排序作業 OrderBy

這個方法是使用延後執行來實作。 立即傳回值是一個物件,會儲存執行動作所需的所有資訊。 除非直接呼叫其 GetEnumerator 方法 foreach 或在 Visual C# For Each 或 Visual Basic 中使用 來列舉對象,否則不會執行這個方法所代表的查詢。

另請參閱

適用於

ThenByDescending<TRow,TKey>(OrderedEnumerableRowCollection<TRow>, Func<TRow,TKey>, IComparer<TKey>)

來源:
EnumerableRowCollectionExtensions.cs
來源:
EnumerableRowCollectionExtensions.cs
來源:
EnumerableRowCollectionExtensions.cs

依據指定的索引鍵和比較子,按遞減順序執行 EnumerableRowCollection 中資料列的次要排序作業。

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

public:
generic <typename TRow, typename TKey>
[System::Runtime::CompilerServices::Extension]
 static System::Data::OrderedEnumerableRowCollection<TRow> ^ ThenByDescending(System::Data::OrderedEnumerableRowCollection<TRow> ^ source, Func<TRow, TKey> ^ keySelector, System::Collections::Generic::IComparer<TKey> ^ comparer);
public static System.Data.OrderedEnumerableRowCollection<TRow> ThenByDescending<TRow,TKey> (this System.Data.OrderedEnumerableRowCollection<TRow> source, Func<TRow,TKey> keySelector, System.Collections.Generic.IComparer<TKey> comparer);
static member ThenByDescending : System.Data.OrderedEnumerableRowCollection<'Row> * Func<'Row, 'Key> * System.Collections.Generic.IComparer<'Key> -> System.Data.OrderedEnumerableRowCollection<'Row>
<Extension()>
Public Function ThenByDescending(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 所傳回之索引鍵的型別。

參數

keySelector
Func<TRow,TKey>

用來從項目擷取索引鍵的函式。

comparer
IComparer<TKey>

用來比較金鑰的 IComparer<T>

傳回

OrderedEnumerableRowCollection<TRow>,其項目是根據指定的索引鍵和比較子進行排序。

備註

使用 ThenByDescending 作業需要使用 現有的主要排序作業 OrderBy

這個方法是使用延後執行來實作。 立即傳回值是一個物件,會儲存執行動作所需的所有資訊。 除非直接呼叫其 GetEnumerator 方法 foreach 或在 Visual C# For Each 或 Visual Basic 中使用 來列舉對象,否則不會執行這個方法所代表的查詢。

另請參閱

適用於