Table of Contents

Class NamedRuleFunction

Namespace
RuleWright.Extensions.Functions
Assembly
RuleWright.Extensions.Functions.dll

An IRuleFunction backed by a delegate — a name plus a predicate over the resolved field value and the leaf's constant value. Immutable and therefore thread-safe, as IRuleFunction requires. Use it to define ad-hoc custom functions inline, or as the building block for a reusable catalog (see BuiltInFunctions).

public sealed class NamedRuleFunction : IRuleFunction, IRuleFunctionMetadata
Inheritance
NamedRuleFunction
Implements
Inherited Members

Constructors

NamedRuleFunction(string, Func<object?, object?, bool>, string?, RuleFunctionValueKind)

Creates a named function from a predicate.

Properties

Description

A short, human-readable description of what the function checks.

Name

The name the function is referenced by in rule JSON. Case-sensitive.

ValueKind

A coarse hint about the shape of the value operand this function expects.

Methods

Evaluate(object?, object?)

Evaluates the condition.