Sorting
Table Of Contents
Sorting The Query
Sorting can be used to build your Query instance.
To learn about how to craft the Query instance go to the Filtering section of the documentation.
You can also check out the Query Syntax section of the documentation.
Property Enum
When The Sharp Factory App generates the C# code in your solution, amongst other things, it generates a collection of enumerations that represent all the properties of each entity.
The naming convention is EntityName + Property. For example an Entity called Customer will have a corresponding enum called CustomerProperty.
The below code sample shows how to sort the results by the Customer's Last Name ascending.
Sort Ascending
To sort the results of your query in ascending order you can call the OrderBy method on the Query class.
This method takes a Property Enum as parameter.
Fluent Syntax
Builder Syntax
Sort Descending
To sort the results of your query in descending order you can call the OrderByDescending method on the Query class.
This method takes a Property Enum as parameter.
The below code sample shows how to sort the results by the Customer's Last Name descending