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>?).
| 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 |
public static class BuiltInFunctions
- Inheritance
-
BuiltInFunctions
- Inherited Members
Properties
Methods
- Create(Func<DateTime>?)
Creates the built-in functions with a custom clock for the date-relativity predicates (
IsInPast,IsInFuture) — useful for deterministic tests.