Table of Contents

Class MinimumDecimalValueValidationRule

Namespace
Kentico.Xperience.Admin.Base.Forms
Assembly
Kentico.Xperience.Admin.Base.dll

Validates whether value satisfies the MinValue limit.

[ValidationRuleAttribute(typeof(MinimumDecimalValueValidationRuleAttribute))]
public sealed class MinimumDecimalValueValidationRule : ValidationRule<MinimumDecimalValueValidationRuleProperties, MinimumDecimalValueValidationRuleClientProperties, decimal?>, IValidationRule
Inheritance
object
MinimumDecimalValueValidationRule
Implements
Inherited Members
Extension Methods

Constructors

MinimumDecimalValueValidationRule(ILocalizationService)

Creates a new instance of MinimumDecimalValueValidationRule class.

public MinimumDecimalValueValidationRule(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(MinimumDecimalValueValidationRuleClientProperties)

Allows set validation rule client properties.

protected override Task ConfigureClientProperties(MinimumDecimalValueValidationRuleClientProperties clientProperties)

Parameters

clientProperties MinimumDecimalValueValidationRuleClientProperties

Current instance of client properties.

Returns

Task

Validate(decimal?, IFormFieldValueProvider)

Validates whether value is more than or equal to MinValue.

public override Task<ValidationResult> Validate(decimal? value, IFormFieldValueProvider formFieldValueProvider)

Parameters

value decimal?

Value to be validated.

formFieldValueProvider IFormFieldValueProvider

Provider of values of other form fields for contextual validation.

Returns

Task<ValidationResult>

Validation result object.