PriceRangeAttribute

Ecng.ComponentModel

Validates that a Price value is within the specified range (inclusive).

Наследует: RangeAttribute

Реализует: IValidator

Конструкторы

PriceRangeAttribute
public PriceRangeAttribute(decimal minimum, decimal maximum)
priceRangeAttribute = PriceRangeAttribute(minimum, maximum)

Creates a new instance of PriceRangeAttribute.

minimum
Minimum value (inclusive).
maximum
Maximum value (inclusive).

Свойства

DisableNullCheck
public bool DisableNullCheck { get; set; }
value = priceRangeAttribute.DisableNullCheck
priceRangeAttribute.DisableNullCheck = value

Gets or sets a value indicating whether null checks should be disabled.

MaximumDec
public decimal MaximumDec { get; }
value = priceRangeAttribute.MaximumDec

Maximum value (inclusive).

MinimumDec
public decimal MinimumDec { get; }
value = priceRangeAttribute.MinimumDec

Minimum value (inclusive).

Методы

IsValid
public override bool IsValid(object value)
result = priceRangeAttribute.IsValid(value)

Validates the specified value by converting it and applying the custom validation.

value
The value to validate.

Возвращает: True if the value is valid; otherwise, false.