logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    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.

    Inheritance
    object
    StructuredQuery
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    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 offset is negative.

    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>
    In this article
    © 2026 Serenity. All Rights Reserved