MetalamaAPI documentationPatterns APIMetalama.​Patterns.​ContractsStrictly­Greater­Than­Attribute
Open sandboxFocus

StrictlyGreaterThanAttribute Class

Custom attribute that, when added to a field, property or parameter, throws an ArgumentOutOfRangeException if the target is assigned a value that is smaller than or equal to a given value.

Namespace: Metalama.Patterns.Contracts
Assembly: Metalama.Patterns.Contracts.dll
Syntax
public class StrictlyGreaterThanAttribute : RangeAttribute, IAspect<IParameter>, IEligible<IParameter>, IAspect<IFieldOrPropertyOrIndexer>, IEligible<IFieldOrPropertyOrIndexer>, IConditionallyInheritableAspect, IAspect, ICompileTimeSerializable, ITemplateProvider
Remarks

Null values are accepted and do not throw an exception.

Floating-point values are tested to be greater than or equal to the minimum value plus a tolerance value. The tolerance value is equal to the distance of the value closest to the minimum value according to the precision of the respective floating-point numerical data type.

Constructors

Name Description
StrictlyGreaterThanAttribute(Byte)

Initializes a new instance of the StrictlyGreaterThanAttribute class specifying a minimum value of type Byte.

StrictlyGreaterThanAttribute(Decimal)

Initializes a new instance of the StrictlyGreaterThanAttribute class specifying a minimum value of type Decimal.

StrictlyGreaterThanAttribute(Double)

Initializes a new instance of the StrictlyGreaterThanAttribute class specifying a minimum value of type Double.

StrictlyGreaterThanAttribute(Int16)

Initializes a new instance of the StrictlyGreaterThanAttribute class specifying a minimum value of type Int16.

StrictlyGreaterThanAttribute(Int32, Int32)

Initializes a new instance of the StrictlyGreaterThanAttribute class specifying a minimum value of type Int32.

StrictlyGreaterThanAttribute(Int64, Int32)

Initializes a new instance of the StrictlyGreaterThanAttribute class specifying a minimum value of type Int64.

StrictlyGreaterThanAttribute(SByte)

Initializes a new instance of the StrictlyGreaterThanAttribute class specifying a minimum value of type SByte.

StrictlyGreaterThanAttribute(Single)

Initializes a new instance of the StrictlyGreaterThanAttribute class specifying a minimum value of type Single.

StrictlyGreaterThanAttribute(UInt16)

Initializes a new instance of the StrictlyGreaterThanAttribute class specifying a minimum value of type UInt16.

StrictlyGreaterThanAttribute(UInt32)

Initializes a new instance of the StrictlyGreaterThanAttribute class specifying a minimum value of type UInt32.

StrictlyGreaterThanAttribute(UInt64)

Initializes a new instance of the StrictlyGreaterThanAttribute class specifying a minimum value of type UInt64.

Methods

Name Description
OnContractViolated(Object)

See Also