Table of Contents

Class ComparableNullOrNotNegativeAttribute<T>

Namespace
Ecng.ComponentModel
Assembly
Ecng.ComponentModel.dll

Indicates that a comparable value must be either null or not negative.

public abstract class ComparableNullOrNotNegativeAttribute<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
ComparableNullOrNotNegativeAttribute<T>
Implements
Derived
Inherited Members
Extension Methods

Constructors

ComparableNullOrNotNegativeAttribute()

protected ComparableNullOrNotNegativeAttribute()

Methods

Validate(T?, bool)

Validates that the value is null or not negative.

protected override bool Validate(T? value, bool disableNullCheck)

Parameters

value T?

The nullable value to validate.

disableNullCheck bool

A 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 not negative; otherwise, false.