Table of Contents

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

Skip int?

Number of records to skip (for pagination).

Take int?

Maximum number of records to return (for pagination).

OrderBy string

Property name to order by.

Descending bool

Whether 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

QueryOptions

Descending

Whether to sort in descending order.

public bool Descending { get; init; }

Property Value

bool

OrderBy

Property name to order by.

public string? OrderBy { get; init; }

Property Value

string

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?