Class MaximumDoubleValueValidationRule
Validates whether value satisfies the MaxValue limit.
[ValidationRuleAttribute(typeof(MaximumDoubleValueValidationRuleAttribute))]
public sealed class MaximumDoubleValueValidationRule : ValidationRule<MaximumDoubleValueValidationRuleProperties, MaximumDoubleValueValidationRuleClientProperties, double?>, IValidationRule
- Inheritance
-
objectValidationRule<MaximumDoubleValueValidationRuleProperties, MaximumDoubleValueValidationRuleClientProperties, double?>MaximumDoubleValueValidationRule
- Implements
- Inherited Members
- Extension Methods
Constructors
MaximumDoubleValueValidationRule(ILocalizationService)
Creates a new instance of MaximumDoubleValueValidationRule class.
public MaximumDoubleValueValidationRule(ILocalizationService localizationService)
Parameters
localizationService
ILocalizationService
Properties
ClientRuleName
Gets the client rule name identifier.
public override string ClientRuleName { get; }
Property Value
- string
DefaultErrorMessage
Defines default error message of the validation rule.
protected override string DefaultErrorMessage { get; }
Property Value
- string
ErrorMessageFormatter
Defines a formatter function for error message.
protected override Func<string, string> ErrorMessageFormatter { get; }
Property Value
- Func<string, string>
Remarks
Formatter is applied for DefaultErrorMessage or ErrorMessage. The custom error message defined by ErrorMessage is considered as a localized and formatted by the caller.
Methods
ConfigureClientProperties(MaximumDoubleValueValidationRuleClientProperties)
Allows set validation rule client properties.
protected override Task ConfigureClientProperties(MaximumDoubleValueValidationRuleClientProperties clientProperties)
Parameters
clientProperties
MaximumDoubleValueValidationRuleClientPropertiesCurrent instance of client properties.
Returns
- Task
Validate(double?, IFormFieldValueProvider)
Validates whether value
is less than or equal to MaxValue.
public override Task<ValidationResult> Validate(double? value, IFormFieldValueProvider formFieldValueProvider)
Parameters
value
double?Value to be validated.
formFieldValueProvider
IFormFieldValueProviderProvider of values of other form fields for contextual validation.
Returns
- Task<ValidationResult>
Validation result object.