Constructor NamedRuleFunction
- Namespace
- RuleWright.Extensions.Functions
- Assembly
- RuleWright.Extensions.Functions.dll
NamedRuleFunction(string, Func<object?, object?, bool>, string?, RuleFunctionValueKind)
Creates a named function from a predicate.
public NamedRuleFunction(string name, Func<object?, object?, bool> predicate, string? description = null, RuleFunctionValueKind valueKind = RuleFunctionValueKind.Unspecified)
Parameters
namestringThe case-sensitive name used in rule JSON (
"custom"leaves).predicateFunc<object, object, bool>The predicate over the field value and the leaf's constant value.
descriptionstringAn optional short description of what the function checks, surfaced via IRuleFunctionMetadata for rule-authoring UIs. Defaults to null.
valueKindRuleFunctionValueKindA hint about the shape of the
valueoperand this function expects, surfaced via IRuleFunctionMetadata. Defaults to Unspecified.
Exceptions
- ArgumentException
nameis null or empty.- ArgumentNullException
predicateis null.