Class ConfigurablePropertyValidator<T, TProperty, TOptions>
- Namespace
- ExpressValidator
- Assembly
- ExpressValidator.dll
public class ConfigurablePropertyValidator<T, TProperty, TOptions> : PropertyValidator<T, TProperty>, IPropertyValidator<T, TProperty>, IPropertyValidator
Type Parameters
TTPropertyTOptions
- Inheritance
-
PropertyValidator<T, TProperty>ConfigurablePropertyValidator<T, TProperty, TOptions>
- Implements
-
IPropertyValidator<T, TProperty>IPropertyValidator
- Inherited Members
-
PropertyValidator<T, TProperty>.IsValid(ValidationContext<T>, TProperty)PropertyValidator<T, TProperty>.Name
Properties
Name
The name of the validator. This is usually the type name without any generic parameters. This is used as the default Error Code for the validator.
public override string Name { get; }
Property Value
Methods
GetDefaultMessageTemplate(string)
Returns the default error message template for this validator, when not overridden.
protected override string GetDefaultMessageTemplate(string errorCode)
Parameters
errorCodestringThe currently configured error code for the validator.
Returns
IsValid(ValidationContext<T>, TProperty)
Validates a specific property value.
public override bool IsValid(ValidationContext<T> context, TProperty value)
Parameters
contextValidationContext<T>The validation context. The parent object can be obtained from here.
valueTPropertyThe current property value to validate
Returns
- bool
True if valid, otherwise false.