DbExpressionBuilder.OrderBy Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
OrderBy(DbExpression, Func<DbExpression,DbExpression>) |
Creates a new DbSortExpression that sorts the given input set by the specified sort key, with ascending sort order and default collation. |
OrderBy(DbExpression, Func<DbExpression,DbExpression>, String) |
Creates a new DbSortExpression that sorts the given input set by the specified sort key, with ascending sort order and the specified collation. |
OrderBy(DbExpression, Func<DbExpression,DbExpression>)
Creates a new DbSortExpression that sorts the given input set by the specified sort key, with ascending sort order and default collation.
public static System.Data.Entity.Core.Common.CommandTrees.DbSortExpression OrderBy (this System.Data.Entity.Core.Common.CommandTrees.DbExpression source, Func<System.Data.Entity.Core.Common.CommandTrees.DbExpression,System.Data.Entity.Core.Common.CommandTrees.DbExpression> sortKey);
static member OrderBy : System.Data.Entity.Core.Common.CommandTrees.DbExpression * Func<System.Data.Entity.Core.Common.CommandTrees.DbExpression, System.Data.Entity.Core.Common.CommandTrees.DbExpression> -> System.Data.Entity.Core.Common.CommandTrees.DbSortExpression
<Extension()>
Public Function OrderBy (source As DbExpression, sortKey As Func(Of DbExpression, DbExpression)) As DbSortExpression
Parameters
- source
- DbExpression
An expression that specifies the input set.
- sortKey
- Func<DbExpression,DbExpression>
A method that specifies how to derive the sort key expression given a member of the input set. This method must produce an expression with an order-comparable result type that provides the sort key definition.
Returns
A new DbSortExpression that represents the order-by operation.
Exceptions
The expression produced by sortKey is null.
The expression produced by sortKey does not have an order-comparable result type.
Applies to
OrderBy(DbExpression, Func<DbExpression,DbExpression>, String)
Creates a new DbSortExpression that sorts the given input set by the specified sort key, with ascending sort order and the specified collation.
public static System.Data.Entity.Core.Common.CommandTrees.DbSortExpression OrderBy (this System.Data.Entity.Core.Common.CommandTrees.DbExpression source, Func<System.Data.Entity.Core.Common.CommandTrees.DbExpression,System.Data.Entity.Core.Common.CommandTrees.DbExpression> sortKey, string collation);
static member OrderBy : System.Data.Entity.Core.Common.CommandTrees.DbExpression * Func<System.Data.Entity.Core.Common.CommandTrees.DbExpression, System.Data.Entity.Core.Common.CommandTrees.DbExpression> * string -> System.Data.Entity.Core.Common.CommandTrees.DbSortExpression
<Extension()>
Public Function OrderBy (source As DbExpression, sortKey As Func(Of DbExpression, DbExpression), collation As String) As DbSortExpression
Parameters
- source
- DbExpression
An expression that specifies the input set.
- sortKey
- Func<DbExpression,DbExpression>
A method that specifies how to derive the sort key expression given a member of the input set. This method must produce an expression with an order-comparable result type that provides the sort key definition.
- collation
- String
The collation to sort under.
Returns
A new DbSortExpression that represents the order-by operation.
Exceptions
The expression produced by sortKey is null.
The expression produced by sortKey does not have an order-comparable string result type.
collation is empty or contains only space characters.
Applies to
Entity Framework