Table of Contents

Class SingleFieldFormValidationRule<TProperties, TValue>

Namespace
Kentico.Forms.Web.Mvc
Assembly
Kentico.Content.Web.Mvc.dll

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

TProperties

The type of validation rule properties.

TValue

The type form field value.

Inheritance
object
FormValidationRule<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

value object

The value to validate.

cancellationToken CancellationToken

The 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

value TValue

The value to validate.

cancellationToken CancellationToken

The cancellation token.

Returns

Task<bool>