CustomValidatorExtensions<T, TProperty> extension

Extension methods for custom validators (predicate-based).

on

Methods

must(bool predicate(TProperty?), String errorMessage) PropertyRule<T, TProperty>

Available on PropertyRule<T, TProperty>, provided by the CustomValidatorExtensions extension

Adds a custom validation rule using a predicate.
mustAsync(Future<bool> predicate(TProperty?), String errorMessage) PropertyRule<T, TProperty>

Available on PropertyRule<T, TProperty>, provided by the CustomValidatorExtensions extension

Adds a custom asynchronous validation rule.
mustAsyncWith(Future<bool> predicate(T instance, TProperty? value), String errorMessage) PropertyRule<T, TProperty>

Available on PropertyRule<T, TProperty>, provided by the CustomValidatorExtensions extension

Adds a custom asynchronous validation rule with access to the entire object.
mustWith(bool predicate(T instance, TProperty? value), String errorMessage) PropertyRule<T, TProperty>

Available on PropertyRule<T, TProperty>, provided by the CustomValidatorExtensions extension

Adds a custom validation rule with access to the entire object.