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.
| Class | What it represents |
|---|---|
Condition | A single filter predicate (field + operator + values). |
ConditionGroup | An And / Or grouping of conditions and nested groups. |
ConditionSet | One member of a Segment joined by set operations. |
OrderBy | A single sort criterion (field + direction). |
GroupBy | Group-key fields plus a list of aggregations. |
AggregateBy | One aggregation (Count / Sum / Min / Max / Avg) with an alias. |
PageBy | Pagination — page number and page size. |
Complex classes
Top-level shapes you serialize from the front-end and pass to extension methods.
| Class | What it represents |
|---|---|
Filter | Where + select + order + page in one object. |
Segment | Multiple condition sets combined with Union / Intersect / Except. |
Summary | Where → group → having → order → page for aggregate reporting. |
Result classes
Returned by the terminal extension methods. Always contain pagination metadata.
| Class | Returned by |
|---|---|
FilterResult<T> | ToListFilter / ToListAsyncFilter / dynamic variants. |
SegmentResult<T> | ToListAsyncSegment. |
SummaryResult | ToListSummary / ToListAsyncSummary. |
Next
- Condition → the smallest filter unit.
- Filter → the most common top-level shape.
- JSON Cookbook → copy-pasteable end-to-end examples.