Open sandboxFocus

Class GreaterThanAttribute

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 bound. The behavior when the target is exactly assigned to the bound depends on the DefaultInequalityStrictness option. If this option is not specified, a warning is reported.

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(short)

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

GreaterThanAttribute(int, int)

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

GreaterThanAttribute(long, int)

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

GreaterThanAttribute(sbyte)

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

GreaterThanAttribute(float)

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

GreaterThanAttribute(ushort)

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

GreaterThanAttribute(uint)

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

GreaterThanAttribute(ulong)

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

Methods

Name Description
OnContractViolated(dynamic?, NumericRange, ContractContext)

See Also