Table of Contents

Namespace RuleWright.Extensions.Functions

Classes

BuiltInFunctions

A small, curated catalog of ready-made IRuleFunction predicates for the custom operator — the things the closed built-in operator vocabulary deliberately does not cover: case-insensitive comparison, emptiness/format checks, number parity and divisibility, and date relativity. Every predicate is total: given a value of an unexpected shape it returns false rather than throwing.

Reference one by Name in a rule leaf, e.g. { "operator": "custom", "name": "IsEven", "field": "Order.ItemCount" }, after registering the set with RegisterBuiltInFunctions(RuleWrightBuilder, Func<DateTime>?).

IsNullOrEmptyfield is null or an empty string
IsNullOrWhiteSpacefield is null, empty, or whitespace
EqualsIgnoreCasefield equals the value ignoring case (ordinal)
IsEmailfield looks like an email address
IsEven / IsOddfield is an even / odd integer
IsPositive / IsNegativefield is a number > 0 / < 0
DivisibleByfield is an integer divisible by the value
IsBetweenInclusivefield is within the [min, max] value array
IsWeekend / IsWeekdayfield date falls on a weekend / weekday
IsInPast / IsInFuturefield date is before / after now
NamedRuleFunction

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).

RuleWrightFunctionExtensions

Convenience registration and discovery helpers over RegisterFunction(IRuleFunction): register many functions at once, register the whole built-in catalog, or scan an assembly for function implementations.