DynamicWhere.ex
DynamicWhere.exv2.1.0·docs

ConditionSet

A ConditionSet is one member of a Segment. Each set carries its own ConditionGroup filter, and every set after the first specifies an Intersection (Union / Intersect / Except) that joins it with the previous set's result.

Properties

PropertyTypeDescription
SortintExecution order (must be unique). The first set's Intersection is ignored.
IntersectionIntersection?Set operation to apply with the previous set's result. Required for index 1+.
ConditionGroupConditionGroupThe filter for this set.
Intersection rules
  • The set with the lowest Sort is the seed — its Intersection is ignored.
  • Every other set must provide an Intersection. Omitting it triggers a validation error.

C# example

var sets = new List<ConditionSet>
{
    new ConditionSet
    {
        Sort = 0,
        // Intersection ignored for the first set
        ConditionGroup = new ConditionGroup
        {
            Connector = Connector.And,
            Conditions = new List<Condition>
            {
                new Condition
                {
                    Sort = 1, Field = "Country",
                    DataType = DataType.Text, Operator = Operator.Equal,
                    Values = new List<object> { "IQ" }
                }
            }
        }
    },
    new ConditionSet
    {
        Sort = 1,
        Intersection = Intersection.Union,
        ConditionGroup = new ConditionGroup
        {
            Connector = Connector.And,
            Conditions = new List<Condition>
            {
                new Condition
                {
                    Sort = 1, Field = "IsVip",
                    DataType = DataType.Boolean, Operator = Operator.Equal,
                    Values = new List<object> { true }
                }
            }
        }
    }
};

JSON example

[
  {
    "sort": 0,
    "intersection": null,
    "conditionGroup": {
      "connector": "And",
      "conditions": [
        { "sort": 1, "field": "Country", "dataType": "Text", "operator": "Equal", "values": ["IQ"] }
      ],
      "subConditionGroups": []
    }
  },
  {
    "sort": 1,
    "intersection": "Union",
    "conditionGroup": {
      "connector": "And",
      "conditions": [
        { "sort": 1, "field": "IsVip", "dataType": "Boolean", "operator": "Equal", "values": [true] }
      ],
      "subConditionGroups": []
    }
  }
]

See also