Class OrderByClause
The orderBy clause of an EntityQuery - the properties to sort by, and their directions.
public class OrderByClause
- Inheritance
-
OrderByClause
- Inherited Members
Remarks
Each path may carry a direction, as in "OrderDate desc"; anything other than "desc" after the path sorts ascending. A path may walk navigation properties, as in "Customer.CompanyName".
Constructors
OrderByClause(IEnumerable<string>)
Create an orderBy clause, splitting each path from its optional direction.
public OrderByClause(IEnumerable<string> propertyPaths)
Parameters
propertyPathsIEnumerable<string>The sort paths, each optionally followed by "desc", e.g. "OrderDate desc".
Properties
OrderByItems
The sort paths split into property and direction.
public IEnumerable<OrderByClause.OrderByItem> OrderByItems { get; }
Property Value
PropertyPaths
The sort paths as they were written, direction included.
public IEnumerable<string> PropertyPaths { get; }
Property Value
Methods
From(IEnumerable?)
Build an orderBy clause, or null if the query does not sort.
public static OrderByClause? From(IEnumerable? propertyPaths)
Parameters
propertyPathsIEnumerableThe sort paths; null when the query has no orderBy clause.
Returns
- OrderByClause
The clause, or null if
propertyPathswas null.
Validate(Type)
Resolve every sort path against the entity type being queried.
public void Validate(Type entityType)
Parameters
entityTypeTypeThe type the query returns.
Exceptions
- Exception
A path does not name a property of that type.