Class StructuredQuery
A read query against an IStructuredStore table: every filter is ANDed, results are sorted by Ordering, then collapsed to the FIRST record per DistinctBy group (under that same ordering), then paginated by Offset/Limit.
Inherited Members
Namespace: Serenity.Persistence.Domain.ValueObjects
Assembly: Serenity.Global.Domain.dll
Syntax
public sealed class StructuredQuery
Constructors
StructuredQuery(IReadOnlyList<FieldFilter>, IReadOnlyList<string>, IReadOnlyList<OrderField>, int, int?)
Creates a new StructuredQuery.
Declaration
public StructuredQuery(IReadOnlyList<FieldFilter> filters = null, IReadOnlyList<string> distinctBy = null, IReadOnlyList<OrderField> ordering = null, int offset = 0, int? limit = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<FieldFilter> | filters | |
| IReadOnlyList<string> | distinctBy | |
| IReadOnlyList<OrderField> | ordering | |
| int | offset | |
| int? | limit |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown when |
Properties
DistinctBy
Fields whose combined value collapses matching records to one per distinct group. Empty means no collapsing.
Declaration
public IReadOnlyList<string> DistinctBy { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<string> |
Filters
Predicates ANDed together to select matching records.
Declaration
public IReadOnlyList<FieldFilter> Filters { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<FieldFilter> |
Limit
Maximum number of results to return, or null for unbounded.
Declaration
public int? Limit { get; }
Property Value
| Type | Description |
|---|---|
| int? |
Offset
Number of leading results to skip. Always zero or greater.
Declaration
public int Offset { get; }
Property Value
| Type | Description |
|---|---|
| int |
Ordering
Multi-field ordering applied before pagination and before distinct-collapsing.
Declaration
public IReadOnlyList<OrderField> Ordering { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<OrderField> |