ConditionGroup
A ConditionGroup joins zero or more Condition objects and zero or more nested ConditionGroup objects with a single logical Connector (And or Or). Groups can be nested to unlimited depth.
Properties
| Property | Type | Description |
|---|---|---|
Sort | int | Evaluation order among sibling sub-groups. |
Connector | Connector | Logical operator joining children (And / Or). |
Conditions | List<Condition> | Flat conditions in this group. |
SubConditionGroups | List<ConditionGroup> | Nested condition groups (unlimited depth). |
C# example
var group = new ConditionGroup
{
Connector = Connector.And,
Conditions = new List<Condition>
{
new Condition
{
Sort = 1,
Field = "IsActive",
DataType = DataType.Boolean,
Operator = Operator.Equal,
Values = new List<object> { true }
}
},
SubConditionGroups = new List<ConditionGroup>
{
new ConditionGroup
{
Sort = 1,
Connector = Connector.Or,
Conditions = new List<Condition>
{
new Condition
{
Sort = 1, Field = "Country",
DataType = DataType.Text, Operator = Operator.Equal,
Values = new List<object> { "IQ" }
},
new Condition
{
Sort = 2, Field = "Country",
DataType = DataType.Text, Operator = Operator.Equal,
Values = new List<object> { "SA" }
}
}
}
}
};JSON example with nested groups
Reads as IsActive = true AND (Country = "IQ" OR Country = "SA"):
{
"connector": "And",
"conditions": [
{
"sort": 1,
"field": "IsActive",
"dataType": "Boolean",
"operator": "Equal",
"values": [true]
}
],
"subConditionGroups": [
{
"sort": 1,
"connector": "Or",
"conditions": [
{ "sort": 1, "field": "Country", "dataType": "Text", "operator": "Equal", "values": ["IQ"] },
{ "sort": 2, "field": "Country", "dataType": "Text", "operator": "Equal", "values": ["SA"] }
],
"subConditionGroups": []
}
]
}Sort matters
Sort values must be unique per level. They determine evaluation order — useful when readers of the saved JSON care about predicate order.
See also
- Condition →
- Filter → wraps a ConditionGroup as its where-clause.
- Summary → uses a ConditionGroup for both
whereandhaving. - Validation →