MetalamaAPI documentationPatterns APIMetalama.​Patterns.​ContractsLess­Than­AttributeLess­Than­Attribute
Open sandboxFocus

LessThanAttribute Constructor

LessThanAttribute(Int64, Int32)

Initializes a new instance of the LessThanAttribute class specifying a maximum value of type Int64.

Declaration
public LessThanAttribute(long max, int decimalPlaces = 0)
Parameters
Type Name Description
Int64 max

The maximum allowed value.

Int32 decimalPlaces

When non-zero, interprets the max number as Decimal instead of Int64 by adding a decimal point at the specified position. For instance, if max is set to 1234 and decimalPlaces is set to 3, the max parameter will be reinterpreted as 1.234m.

LessThanAttribute(Int32, Int32)

Initializes a new instance of the LessThanAttribute class specifying a maximum value of type Int32.

Declaration
public LessThanAttribute(int max, int decimalPlaces = 0)
Parameters
Type Name Description
Int32 max

The maximum allowed value.

Int32 decimalPlaces

When non-zero, interprets the max number as Decimal instead of Int64 by adding a decimal point at the specified position. For instance, if max is set to 1234 and decimalPlaces is set to 3, the max parameter will be reinterpreted as 1.234m.

LessThanAttribute(Int16)

Initializes a new instance of the LessThanAttribute class specifying a maximum value of type Int16.

Declaration
public LessThanAttribute(short max)
Parameters
Type Name Description
Int16 max

The maximum allowed value.

LessThanAttribute(SByte)

Initializes a new instance of the LessThanAttribute class specifying a maximum value of type SByte.

Declaration
public LessThanAttribute(sbyte max)
Parameters
Type Name Description
SByte max

The maximum allowed value.

LessThanAttribute(UInt64)

Initializes a new instance of the LessThanAttribute class specifying a maximum value of type UInt64.

Declaration
public LessThanAttribute(ulong max)
Parameters
Type Name Description
UInt64 max

The maximum allowed value.

LessThanAttribute(UInt32)

Initializes a new instance of the LessThanAttribute class specifying a maximum value of type UInt32.

Declaration
public LessThanAttribute(uint max)
Parameters
Type Name Description
UInt32 max

The maximum allowed value.

LessThanAttribute(UInt16)

Initializes a new instance of the LessThanAttribute class specifying a maximum value of type UInt16.

Declaration
public LessThanAttribute(ushort max)
Parameters
Type Name Description
UInt16 max

The maximum allowed value.

LessThanAttribute(Byte)

Initializes a new instance of the LessThanAttribute class specifying a maximum value of type Byte.

Declaration
public LessThanAttribute(byte max)
Parameters
Type Name Description
Byte max

The maximum allowed value.

LessThanAttribute(Double)

Initializes a new instance of the LessThanAttribute class specifying a maximum value of type Double.

Declaration
public LessThanAttribute(double max)
Parameters
Type Name Description
Double max

The maximum allowed value.

LessThanAttribute(Single)

Initializes a new instance of the LessThanAttribute class specifying a maximum value of type Single.

Declaration
public LessThanAttribute(float max)
Parameters
Type Name Description
Single max

The maximum allowed value.

LessThanAttribute(Decimal)

Initializes a new instance of the LessThanAttribute class specifying a maximum value of type Decimal.

Declaration
public LessThanAttribute(Decimal max)
Parameters
Type Name Description
Decimal max

The maximum allowed value.