You can order the results by adding an OrderBy() clause on the query. This allows you to order by properties directly on the returned object.
The order can be defined in multiple ways using the extension on the query object, for example:
Order By |
Syntax |
---|---|
Order by a specific property definition UID, as default, this will sort ascending. |
lobjDynamicQuery.Query.OrderBy("DEVWeight") |
Order by a specific property definition UID with an overload of the sort order. |
lobjDynamicQuery.Query.OrderBy("DEVWeight", Order.Descending) |
-
You cannot order by properties on related items.
-
You can sort by multiple properties.