DynamicWhere.ex
DynamicWhere.exv2.1.0·docs

Classes

DynamicWhere.ex is shaped by a small set of plain C# classes that map 1:1 to JSON. Mix them together to express any filter, projection, sort, page, group, aggregate, or set operation.

Three categories
Core classes are the building blocks. Complex classes are the top-level shapes you send from a client. Result classes are the strongly-typed wrappers you get back.

Core classes

Small composable pieces. You rarely send these on their own.

ClassWhat it represents
ConditionA single filter predicate (field + operator + values).
ConditionGroupAn And / Or grouping of conditions and nested groups.
ConditionSetOne member of a Segment joined by set operations.
OrderByA single sort criterion (field + direction).
GroupByGroup-key fields plus a list of aggregations.
AggregateByOne aggregation (Count / Sum / Min / Max / Avg) with an alias.
PageByPagination — page number and page size.

Complex classes

Top-level shapes you serialize from the front-end and pass to extension methods.

ClassWhat it represents
FilterWhere + select + order + page in one object.
SegmentMultiple condition sets combined with Union / Intersect / Except.
SummaryWhere → group → having → order → page for aggregate reporting.

Result classes

Returned by the terminal extension methods. Always contain pagination metadata.

ClassReturned by
FilterResult<T>ToListFilter / ToListAsyncFilter / dynamic variants.
SegmentResult<T>ToListAsyncSegment.
SummaryResultToListSummary / ToListAsyncSummary.

Next