Table of Contents

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

name string

The case-sensitive name used in rule JSON ("custom" leaves).

predicate Func<object, object, bool>

The predicate over the field value and the leaf's constant value.

description string

An optional short description of what the function checks, surfaced via IRuleFunctionMetadata for rule-authoring UIs. Defaults to null.

valueKind RuleFunctionValueKind

A hint about the shape of the value operand this function expects, surfaced via IRuleFunctionMetadata. Defaults to Unspecified.

Exceptions

ArgumentException

name is null or empty.

ArgumentNullException

predicate is null.