PriceStepAttribute

Ecng.ComponentModel

Validates that a Price value lies on a discrete grid defined by Base + n * Step using Value.

継承元: StepAttribute

実装: IValidator

コンストラクター

PriceStepAttribute
public PriceStepAttribute(decimal step, decimal baseValue)
priceStepAttribute = PriceStepAttribute(step, baseValue)

Validates that a Price value lies on a discrete grid defined by Base + n * Step using Value.

step
Positive step.
baseValue
Base value (default 0).

メソッド

IsValid
public override bool IsValid(object value)
result = priceStepAttribute.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.