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.