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.

Inheritance
System.Object
GreaterThanAttribute
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 System.Byte.

GreaterThanAttribute(Decimal)

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

GreaterThanAttribute(Double)

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

GreaterThanAttribute(Int16)

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

GreaterThanAttribute(Int32, Int32)

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

GreaterThanAttribute(Int64, Int32)

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

GreaterThanAttribute(SByte)

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

GreaterThanAttribute(Single)

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

GreaterThanAttribute(UInt16)

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

GreaterThanAttribute(UInt32)

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

GreaterThanAttribute(UInt64)

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

Methods

Name Description
OnContractViolated(Object)

See Also