DbExpressionBuilder.ToSortClause Method

 

Creates a new DbSortClause with an ascending sort order and default collation.

Namespace:   System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder
Assembly:  EntityFramework (in EntityFramework.dll)

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticToSortClause(DbExpression)

Creates a new DbSortClause with an ascending sort order and default collation.

System_CAPS_pubmethodSystem_CAPS_staticToSortClause(DbExpression, String)

Creates a new DbSortClause with an ascending sort order and the specified collation.


DbExpressionBuilder.ToSortClause Method (DbExpression)

Creates a new DbSortClause with an ascending sort order and default collation.

public static DbSortClause ToSortClause(
	this DbExpression key
)

Parameters

key
Type: System.Data.Entity.Core.Common.CommandTrees.DbExpression

The expression that defines the sort key.

Return Value

Type: System.Data.Entity.Core.Common.CommandTrees.DbSortClause

A new sort clause with the given sort key and ascending sort order.

Exception Condition
ArgumentNullException

key is null.

ArgumentException

key does not have an order-comparable result type.


DbExpressionBuilder.ToSortClause Method (DbExpression, String)

Creates a new DbSortClause with an ascending sort order and the specified collation.

public static DbSortClause ToSortClause(
	this DbExpression key,
	string collation
)

Parameters

key
Type: System.Data.Entity.Core.Common.CommandTrees.DbExpression

The expression that defines the sort key.

collation
Type: System.String

The collation to sort under.

Return Value

Type: System.Data.Entity.Core.Common.CommandTrees.DbSortClause

A new sort clause with the given sort key and collation, and ascending sort order.

Exception Condition
ArgumentNullException

key is null.

ArgumentOutOfRangeException

collation is empty or contains only space characters.

ArgumentException

key does not have an order-comparable result type.