Class QueryOptions
- Namespace
- Excalibur.EventSourcing
- Assembly
- Excalibur.EventSourcing.Abstractions.dll
Options for projection queries including pagination and sorting.
public sealed record QueryOptions : IEquatable<QueryOptions>
- Inheritance
-
QueryOptions
- Implements
- Inherited Members
Remarks
Query options control how results are paginated and sorted. All parameters
are optional - pass null values to use provider defaults.
Providers translate these options to their native syntax (e.g., SQL OFFSET/FETCH, MongoDB skip/limit, CosmosDb TOP/OFFSET).
Constructors
QueryOptions(int?, int?, string?, bool)
Options for projection queries including pagination and sorting.
public QueryOptions(int? Skip = null, int? Take = null, string? OrderBy = null, bool Descending = false)
Parameters
Skipint?Number of records to skip (for pagination).
Takeint?Maximum number of records to return (for pagination).
OrderBystringProperty name to order by.
DescendingboolWhether to sort in descending order.
Remarks
Query options control how results are paginated and sorted. All parameters
are optional - pass null values to use provider defaults.
Providers translate these options to their native syntax (e.g., SQL OFFSET/FETCH, MongoDB skip/limit, CosmosDb TOP/OFFSET).
Properties
Default
Default query options with no pagination or sorting.
public static QueryOptions Default { get; }
Property Value
Descending
Whether to sort in descending order.
public bool Descending { get; init; }
Property Value
OrderBy
Property name to order by.
public string? OrderBy { get; init; }
Property Value
Skip
Number of records to skip (for pagination).
public int? Skip { get; init; }
Property Value
- int?
Take
Maximum number of records to return (for pagination).
public int? Take { get; init; }
Property Value
- int?