Class FormValidationRule<TProperties, TValue>
Base abstract class for form builder field validation rules.
public abstract class FormValidationRule<TProperties, TValue> : IFormValidationRule where TProperties : FormValidationRuleProperties, new()
Type Parameters
TPropertiesThe type of validation rule properties.
TValueThe type form field value.
- Inheritance
-
objectFormValidationRule<TProperties, TValue>
- Implements
- Derived
-
SingleFieldFormValidationRule<TProperties, TValue>
- Extension Methods
Remarks
This class should not be used directly. Instead, use derived classes such as SingleFieldFormValidationRule<TProperties, TValue> which provide specific validation functionality for form fields.
Constructors
FormValidationRule()
protected FormValidationRule()
Properties
LocalizationService
Gets the localization service used for retrieving localized strings.
protected ILocalizationService LocalizationService { get; }
Property Value
Properties
Gets the validation rule properties.
public TProperties Properties { get; }
Property Value
- TProperties
Methods
GetDefaultErrorMessage()
Gets the default error message for the validation rule.
public virtual Task<string> GetDefaultErrorMessage()
Returns
- Task<string>
GetProperties()
Gets the actual properties instance from the validation rule.
public FormValidationRuleProperties GetProperties()
Returns
SetProperties(FormValidationRuleProperties)
Sets the form validation rule properties.
public void SetProperties(FormValidationRuleProperties properties)
Parameters
propertiesFormValidationRuleProperties