Open sandboxFocus

Struct NumericRange

Describes a numeric range. Used by RangeAttribute.

Namespace: Metalama.Patterns.Contracts.Numeric
Assembly: Metalama.Patterns.Contracts.dll
Syntax
[RunTimeOrCompileTime]
public readonly struct NumericRange : ICompileTimeSerializable

Constructors

Name Description
NumericRange(NumericBound?, NumericBound?)

Initializes a new instance of the NumericRange struct.

Properties

Name Description
MaxValue

Gets the maximal value, or null if the range has no maximal value.

MinValue

Gets the minimal value, or null if the range has no minimal value.

Methods

Name Description
Create(decimal?, decimal?, bool)
Create(double?, double?, bool)
Create(long?, long?, bool)
Create(ulong?, ulong?, bool)
IsInRange(decimal)

Determines if a value of type decimal is in the current range.

IsInRange(double)

Determines if a value of type double is in the current range.

IsInRange(long)

Determines if a value of type long is in the current range.

IsInRange(object?)

Determines if a value of unknown type is in the current range. Returns false if the type is unsupported.

IsInRange(ulong)

Determines if a value of type ulong is in the current range.

ToString()

See Also