MetalamaAPI documentationPatterns APIMetalama.​Patterns.​ContractsStrict­Range­AttributeStrict­Range­Attribute
Open sandboxFocus

StrictRangeAttribute Constructor

StrictRangeAttribute(Int64, Int64, Int32)

Initializes a new instance of the StrictRangeAttribute class specifying bounds of type Int64.

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

The minimum value.

Int64 max

The maximum value.

Int32 decimalPlaces

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

StrictRangeAttribute(Int32, Int32, Int32)

Initializes a new instance of the StrictRangeAttribute class specifying bounds of type Int32.

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

The minimum value.

Int32 max

The maximum value.

Int32 decimalPlaces

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

StrictRangeAttribute(Int16, Int16)

Initializes a new instance of the StrictRangeAttribute class specifying bounds of type Int16.

Declaration
public StrictRangeAttribute(short min, short max)
Parameters
Type Name Description
Int16 min

The minimum value.

Int16 max

The maximum value.

StrictRangeAttribute(SByte, SByte)

Initializes a new instance of the StrictRangeAttribute class specifying bounds of type SByte.

Declaration
public StrictRangeAttribute(sbyte min, sbyte max)
Parameters
Type Name Description
SByte min

The minimum value.

SByte max

The maximum value.

StrictRangeAttribute(UInt64, UInt64)

Initializes a new instance of the StrictRangeAttribute class specifying bounds of type UInt64.

Declaration
public StrictRangeAttribute(ulong min, ulong max)
Parameters
Type Name Description
UInt64 min

The minimum value.

UInt64 max

The maximum value.

StrictRangeAttribute(UInt32, UInt32)

Initializes a new instance of the StrictRangeAttribute class specifying bounds of type UInt32.

Declaration
public StrictRangeAttribute(uint min, uint max)
Parameters
Type Name Description
UInt32 min

The minimum value.

UInt32 max

The maximum value.

StrictRangeAttribute(UInt16, UInt16)

Initializes a new instance of the StrictRangeAttribute class specifying bounds of type UInt16.

Declaration
public StrictRangeAttribute(ushort min, ushort max)
Parameters
Type Name Description
UInt16 min

The minimum value.

UInt16 max

The maximum value.

StrictRangeAttribute(Byte, Byte)

Initializes a new instance of the StrictRangeAttribute class specifying bounds of type Byte.

Declaration
public StrictRangeAttribute(byte min, byte max)
Parameters
Type Name Description
Byte min

The minimum value.

Byte max

The maximum value.

StrictRangeAttribute(Double, Double)

Initializes a new instance of the StrictRangeAttribute class specifying bounds of type Double.

Declaration
public StrictRangeAttribute(double min, double max)
Parameters
Type Name Description
Double min

The minimum value.

Double max

The maximum value.

StrictRangeAttribute(Single, Single)

Initializes a new instance of the StrictRangeAttribute class specifying bounds of type Single.

Declaration
public StrictRangeAttribute(float min, float max)
Parameters
Type Name Description
Single min

The minimum value.

Single max

The maximum value.

StrictRangeAttribute(Decimal, Decimal)

Initializes a new instance of the StrictRangeAttribute class specifying bounds of type Decimal.

Declaration
public StrictRangeAttribute(Decimal min, Decimal max)
Parameters
Type Name Description
Decimal min

The minimum value.

Decimal max

The maximum value.