Home RuleRegistry Class
RuleRegistry Class
Cancel

RuleRegistry Class

Namespace: Json.Logic

Inheritance: RuleRegistry 🡒 object

Catalogs all of the known rules.

Methods

AddRule()

Registers a new rule type.

Declaration

1
public static void AddRule()

Remarks

Rules must contain a parameterless constructor.

Decorate your rule type with one or more Json.Logic.OperatorAttributes to define its identifier.

Registering a rule with an identifier that already exists will overwrite the existing registration.

AddRule(JsonSerializerContext typeContext)

Registers a new rule type.

Declaration

1
public static void AddRule(JsonSerializerContext typeContext)

Remarks

Rules must contain a parameterless constructor.

Decorate your rule type with one or more Json.Logic.OperatorAttributes to define its identifier.

Registering a rule with an identifier that already exists will overwrite the existing registration.

GetRule(string identifier)

Gets a Json.Logic.Rule implementation for a given identifier string.

Declaration

1
public static Type GetRule(string identifier)
ParameterTypeDescription
identifierstringThe identifier.

Returns

The System.Type of the rule.

Contents