DbExpressionBuilder.OrderBy 方法

定义

使用升序排序顺序和默认排序规则创建按指定排序键对给定输入集进行排序的新 DbSortExpression

重载

名称 说明
OrderBy(DbExpression, Func<DbExpression,DbExpression>)

使用升序排序顺序和默认排序规则创建按指定排序键对给定输入集进行排序的新 DbSortExpression

OrderBy(DbExpression, Func<DbExpression,DbExpression>, String)

使用升序排序顺序和指定的排序规则创建按指定排序键对给定输入集进行排序的新 DbSortExpression

OrderBy(DbExpression, Func<DbExpression,DbExpression>)

使用升序排序顺序和默认排序规则创建按指定排序键对给定输入集进行排序的新 DbSortExpression

public:
[System::Runtime::CompilerServices::Extension]
 static System::Data::Common::CommandTrees::DbSortExpression ^ OrderBy(System::Data::Common::CommandTrees::DbExpression ^ source, Func<System::Data::Common::CommandTrees::DbExpression ^, System::Data::Common::CommandTrees::DbExpression ^> ^ sortKey);
public static System.Data.Common.CommandTrees.DbSortExpression OrderBy(this System.Data.Common.CommandTrees.DbExpression source, Func<System.Data.Common.CommandTrees.DbExpression,System.Data.Common.CommandTrees.DbExpression> sortKey);
static member OrderBy : System.Data.Common.CommandTrees.DbExpression * Func<System.Data.Common.CommandTrees.DbExpression, System.Data.Common.CommandTrees.DbExpression> -> System.Data.Common.CommandTrees.DbSortExpression
<Extension()>
Public Function OrderBy (source As DbExpression, sortKey As Func(Of DbExpression, DbExpression)) As DbSortExpression

参数

source
DbExpression

一个指定输入集的表达式。

sortKey
Func<DbExpression,DbExpression>

一个指定如何派生给定输入集成员的排序键表达式的方法。 此方法必须生成具有提供排序键定义的顺序可比较结果类型的表达式。

返回

一个新的 DbSortExpression,表示按顺序操作。

例外

sourcesortKey 为 null。

-或-

生成的 sortKey 表达式为 null。

source 没有集合结果类型。

-或-

由其 sortKey 生成的表达式没有可比较顺序的结果类型。

适用于

OrderBy(DbExpression, Func<DbExpression,DbExpression>, String)

使用升序排序顺序和指定的排序规则创建按指定排序键对给定输入集进行排序的新 DbSortExpression

public:
[System::Runtime::CompilerServices::Extension]
 static System::Data::Common::CommandTrees::DbSortExpression ^ OrderBy(System::Data::Common::CommandTrees::DbExpression ^ source, Func<System::Data::Common::CommandTrees::DbExpression ^, System::Data::Common::CommandTrees::DbExpression ^> ^ sortKey, System::String ^ collation);
public static System.Data.Common.CommandTrees.DbSortExpression OrderBy(this System.Data.Common.CommandTrees.DbExpression source, Func<System.Data.Common.CommandTrees.DbExpression,System.Data.Common.CommandTrees.DbExpression> sortKey, string collation);
static member OrderBy : System.Data.Common.CommandTrees.DbExpression * Func<System.Data.Common.CommandTrees.DbExpression, System.Data.Common.CommandTrees.DbExpression> * string -> System.Data.Common.CommandTrees.DbSortExpression
<Extension()>
Public Function OrderBy (source As DbExpression, sortKey As Func(Of DbExpression, DbExpression), collation As String) As DbSortExpression

参数

source
DbExpression

一个指定输入集的表达式。

sortKey
Func<DbExpression,DbExpression>

一个指定如何派生给定输入集成员的排序键表达式的方法。 此方法必须生成具有提供排序键定义的顺序可比较结果类型的表达式。

collation
String

要排序的排序规则。

返回

一个新的 DbSortExpression,表示按顺序操作。

例外

source collationsortKey为 null。

-或-

生成的 sortKey 表达式为 null。

source 没有集合结果类型。

-或-

由其 sortKey 生成的表达式没有可比较顺序的字符串结果类型。

collation 为空或仅包含空格字符。

适用于