Condition
A Condition is a single filter predicate — one field, one operator, and zero or more operand values. It is the smallest building block of every filter, segment, or summary you send.
Properties
| Property | Type | Description |
|---|---|---|
Sort | int | Evaluation order within a ConditionGroup (must be unique among siblings). |
Field | string? | Property path on the entity (supports dot notation, e.g. "Order.Customer.Name"). |
DataType | DataType | Logical data type for value parsing. |
Operator | Operator | Comparison operator. |
Values | List<object> | Operand values (count depends on operator). Accepts raw JSON types — strings, numbers, booleans — and is normalized per DataType. See Value Coercion below. |
C# example
var condition = new Condition
{
Sort = 1,
Field = "Name",
DataType = DataType.Text,
Operator = Operator.IContains,
Values = new List<object> { "john" }
};JSON example
{
"sort": 1,
"field": "Name",
"dataType": "Text",
"operator": "IContains",
"values": ["john"]
}Value coercion
Values is List<object> so the front-end can send heterogeneous JSON shapes without quoting every primitive:
{
"Field": "Price",
"DataType": "Number",
"Operator": "Between",
"Values": [0, 1.569]
}{
"Field": "IsActive",
"DataType": "Boolean",
"Operator": "Equal",
"Values": [false]
}The library normalizes every element before validation/build:
| Incoming runtime type | Normalized form |
|---|---|
string | as-is |
bool | "true" / "false" (lowercase) |
JsonElement (System.Text.Json) | unwrapped by ValueKind (String → text, Number → raw JSON token, True/False → lowercase) |
numeric / IFormattable | InvariantCulture formatting |
anything else (JValue, etc.) | value.ToString() |
null | string.Empty |
Backward compatibility
Callers previously sending
["abc"] (quoted strings) keep working unchanged — strings deserialize into the List<object> as string elements. C# callers that previously used Values = new List<string> {...} must switch to new List<object> {...} (or .Cast<object>().ToList()).See also
- ConditionGroup → the parent shape.
- Operator reference → how many values each operator expects.
- DataType reference → parsing rules per type.
- Validation → error codes a malformed condition can throw.