MetalamaAPI documentationPatterns APIMetalama.​Patterns.​ContractsGreater­Than­Attribute
Open sandboxFocus

GreaterThanAttribute 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 a given value.

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

Null values are accepted and do not throw an exception.

Constructors

Name Description
GreaterThanAttribute(Byte)

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

GreaterThanAttribute(Decimal)

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

GreaterThanAttribute(Double)

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

GreaterThanAttribute(Int16)

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

GreaterThanAttribute(Int32, Int32)

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

GreaterThanAttribute(Int64, Int32)

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

GreaterThanAttribute(SByte)

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

GreaterThanAttribute(Single)

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

GreaterThanAttribute(UInt16)

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

GreaterThanAttribute(UInt32)

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

GreaterThanAttribute(UInt64)

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

Methods

Name Description
OnContractViolated(Object)

See Also