DbExpressionBuilder.ThenBy 方法

定義

使用排序順序建立新的 DbSortExpression ,其中包含指定順序輸入集的排序順序,以及遞增排序順序和預設定序的指定排序索引鍵。

多載

ThenBy(DbSortExpression, Func<DbExpression,DbExpression>, String)

使用排序順序建立新的 DbSortExpression ,其中包含指定順序輸入集的排序順序,以及以遞增排序順序的指定排序索引鍵和指定的定序。

ThenBy(DbSortExpression, Func<DbExpression,DbExpression>)

使用排序順序建立新的 DbSortExpression ,其中包含指定順序輸入集的排序順序,以及遞增排序順序和預設定序的指定排序索引鍵。

ThenBy(DbSortExpression, Func<DbExpression,DbExpression>, String)

使用排序順序建立新的 DbSortExpression ,其中包含指定順序輸入集的排序順序,以及以遞增排序順序的指定排序索引鍵和指定的定序。

C#
public static System.Data.Common.CommandTrees.DbSortExpression ThenBy (this System.Data.Common.CommandTrees.DbSortExpression source, Func<System.Data.Common.CommandTrees.DbExpression,System.Data.Common.CommandTrees.DbExpression> sortKey, string collation);

參數

source
DbSortExpression

指定已排序輸入集的 DbSortExpression。

sortKey
Func<DbExpression,DbExpression>

方法,指定如何根據輸入集成員來衍生其他排序索引鍵運算式。 這個方法必須產生具有可比較順序之結果型別的運算式,這個字串結果型別會提供排序索引鍵定義。

collation
String

要做為排序依據的定序。

傳回

新的 DbSortExpression,表示新的整體 order-by 作業。

例外狀況

sourcesortKeycollation 為 null。

-或-

sortKey 所產生的運算式為 null。

source 沒有集合結果類型。

-或-

sortKey 所產生的運算式沒有可比較順序字串結果類型。

collation 是空的或僅包含空白字元。

適用於

.NET Framework 4.8.1 和其他版本
產品 版本
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

ThenBy(DbSortExpression, Func<DbExpression,DbExpression>)

使用排序順序建立新的 DbSortExpression ,其中包含指定順序輸入集的排序順序,以及遞增排序順序和預設定序的指定排序索引鍵。

C#
public static System.Data.Common.CommandTrees.DbSortExpression ThenBy (this System.Data.Common.CommandTrees.DbSortExpression source, Func<System.Data.Common.CommandTrees.DbExpression,System.Data.Common.CommandTrees.DbExpression> sortKey);

參數

source
DbSortExpression

指定已排序輸入集的 DbSortExpression。

sortKey
Func<DbExpression,DbExpression>

方法,指定如何根據輸入集成員來衍生其他排序索引鍵運算式。 這個方法必須產生具有可比較順序之結果型別的運算式,這個字串結果型別會提供排序索引鍵定義。

傳回

新的 DbSortExpression,表示新的整體 order-by 作業。

例外狀況

sourcesortKey 為 null。

-或-

sortKey 所產生的運算式為 null。

source 沒有集合結果類型。

-或-

sortKey 沒有可比較順序結果類型。

適用於

.NET Framework 4.8.1 和其他版本
產品 版本
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1