Class ComparableNullOrMoreZeroAttribute<T>
- Namespace
- Ecng.ComponentModel
- Assembly
- Ecng.ComponentModel.dll
Indicates that a comparable value must be either null or greater than zero.
public abstract class ComparableNullOrMoreZeroAttribute<T> : ComparableValidationAttribute<T>, IValidator where T : struct, IComparable<T>
Type Parameters
T
The type of value to compare. Must be a struct implementing IComparable<T>.
- Inheritance
-
ComparableNullOrMoreZeroAttribute<T>
- Implements
- Derived
- Inherited Members
- Extension Methods
Constructors
ComparableNullOrMoreZeroAttribute()
protected ComparableNullOrMoreZeroAttribute()
Methods
Validate(T?, bool)
Validates that the value is null or greater than zero.
protected override bool Validate(T? value, bool disableNullCheck)
Parameters
value
T?The nullable value to validate.
disableNullCheck
boolA flag indicating whether null check should be disabled (not used in this case).
Returns
- bool
True if the value is null or the non-null value is greater than zero; otherwise, false.