Table of Contents

Class BuiltInFunctions

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

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
public static class BuiltInFunctions
Inheritance
BuiltInFunctions
Inherited Members

Properties

All

The built-in functions, using the system clock (UtcNow) for the date-relativity predicates.

Methods

Create(Func<DateTime>?)

Creates the built-in functions with a custom clock for the date-relativity predicates (IsInPast, IsInFuture) — useful for deterministic tests.