Class SingleFieldFormValidationRule<TProperties, TValue>
Base abstract class for form builder validation rules that validate individual form fields.
public abstract class SingleFieldFormValidationRule<TProperties, TValue> : FormValidationRule<TProperties, TValue>, ISingleFieldFormValidationRule, IFormValidationRule where TProperties : FormValidationRuleProperties, new()
Type Parameters
TPropertiesThe type of validation rule properties.
TValueThe type form field value.
- Inheritance
-
objectFormValidationRule<TProperties, TValue>SingleFieldFormValidationRule<TProperties, TValue>
- Implements
- Inherited Members
- Extension Methods
Constructors
SingleFieldFormValidationRule()
protected SingleFieldFormValidationRule()
Methods
IsValueValid(object, CancellationToken)
Indicates whether value is a valid value of underlying form field.
public Task<bool> IsValueValid(object value, CancellationToken cancellationToken)
Parameters
valueobjectThe value to validate.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task<bool>
Validate(TValue, CancellationToken)
Validates the provided value of type TValue.
protected abstract Task<bool> Validate(TValue value, CancellationToken cancellationToken)
Parameters
valueTValueThe value to validate.
cancellationTokenCancellationTokenThe cancellation token.
Returns
- Task<bool>