PriceValidationAttributeBase
Ecng.ComponentModel
Base validation attribute for Price that validates only the Value component.
Herda de: ValidationAttribute
Implementa: IValidator
Propriedades
AcceptNull
protected virtual bool AcceptNull { get; }
value = priceValidationAttributeBase.AcceptNull
Gets a value indicating whether null price values are always accepted (independently of DisableNullCheck).
DisableNullCheck
public bool DisableNullCheck { get; set; }
value = priceValidationAttributeBase.DisableNullCheck
priceValidationAttributeBase.DisableNullCheck = value
If true, null values are treated as valid (only for attributes where null is not unconditionally allowed).
Métodos
IsValid
public override bool IsValid(object value)
result = priceValidationAttributeBase.IsValid(value)
Validates the specified value by converting it and applying the custom validation.
- value
- The value to validate.
Retorna: True if the value is valid; otherwise, false.
Validate
protected abstract bool Validate(decimal value)
result = priceValidationAttributeBase.Validate(value)
Core validation over the numeric price value (already extracted).
- value
- Price numeric value.