Namespace RuleWright.Extensions.Functions
Classes
- BuiltInFunctions
A small, curated catalog of ready-made IRuleFunction predicates for the
customoperator — 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 returnsfalserather than throwing.Reference one by
Namein a rule leaf, e.g.{ "operator": "custom", "name": "IsEven", "field": "Order.ItemCount" }, after registering the set with RegisterBuiltInFunctions(RuleWrightBuilder, Func<DateTime>?).IsNullOrEmpty field is null or an empty string IsNullOrWhiteSpace field is null, empty, or whitespace EqualsIgnoreCase field equals the value ignoring case (ordinal) IsEmail field looks like an email address IsEven / IsOdd field is an even / odd integer IsPositive / IsNegative field is a number > 0 / < 0 DivisibleBy field is an integer divisible by the value IsBetweenInclusive field is within the [min, max] value array IsWeekend / IsWeekday field date falls on a weekend / weekday IsInPast / IsInFuture field 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.