Table of Contents

Class PagedQuery

Namespace
Quartz
Assembly
Quartz.dll

Base for job store queries whose results can be paged.

public abstract record PagedQuery : IEquatable<PagedQuery>
Inheritance
PagedQuery
Implements
Derived
Inherited Members

Remarks

Results are always ordered by group and then name (ordinal), so a page is deterministic on every job store. Skip and Take are offsets into that ordering; a UI page maps to Skip = (page - 1) * pageSize, Take = pageSize.

A filter is named for what it selects on. Group and Name are the result's own identity — Name is the job's name, Name is the group's — and a filter on something the result merely refers to carries that thing's name: Job, CalendarName, SchedulerInstanceId. That is why FireInstanceQuery alone spells its trigger filters TriggerGroup and TriggerName: a firing is identified by a fire instance id and not by a key, so the trigger it belongs to is a reference like any other, and an unqualified Name there would leave a reader to guess whether it meant the trigger's or the job's.

Every name filter is a matcher of the same family: NameMatcher<TKey> where the name is half of a Key<T>, and the arity-free NameMatcher where it is a bare name — a calendar's, a group's. Every filter is nullable and null means "match everything", so no filter needs an "any" spelling of its own.

Fields

All

The Take that asks for everything the filter matches, however many that is.

public const int All = 2147483647

Field Value

int

Remarks

It is MaxValue, which is what the documentation used to tell readers to type — a magic number for a decision worth stating out loud, and one that reads as an overflow guard rather than as an intention at a call site. Asking for everything is a real thing to want (a group-name list, an export, a migration) and a bad default, which is why Take starts at DefaultTake and this has to be written.

DefaultTake

The page size a query has when Take is not set: 250. One value, defined in one place — the HTTP API applies it too when a request names no take.

public const int DefaultTake = 250

Field Value

int

Properties

IncludeTotalCount

Whether to also compute TotalCount, the number of items that match the query regardless of paging. Off by default because it costs a second query on persistent stores.

public bool IncludeTotalCount { get; init; }

Property Value

bool

Skip

The number of matching items to skip before the first returned item.

public int Skip { get; init; }

Property Value

int

Take

The maximum number of items to return. Defaults to DefaultTake so an unpaged call cannot accidentally materialize an unbounded result; HasMore reports whether anything was left out. Ask for everything explicitly with All. Zero is valid and returns no items — combined with IncludeTotalCount it turns the query into a count.

public int Take { get; init; }

Property Value

int