DynamicWhere.ex
DynamicWhere.exv2.1.0·docs

OrderBy

An OrderBy is a single sort criterion. Pass a list of them to Filter, Segment, or Summary — they apply in Sort order (lower first).

Properties

PropertyTypeDefaultDescription
SortintPriority order (lower = first).
Fieldstring?Property path to sort by.
DirectionDirectionAscendingSort direction.
Note
Default direction is Ascending — you can omit it for ascending sorts.

C# example

var orders = new List<OrderBy>
{
    new OrderBy { Sort = 1, Field = "CreatedAt", Direction = Direction.Descending },
    new OrderBy { Sort = 2, Field = "Name" } // ascending by default
};

JSON example

[
  { "sort": 1, "field": "CreatedAt", "direction": "Descending" },
  { "sort": 2, "field": "Name", "direction": "Ascending" }
]

See also