RangeAttribute Class
Custom attribute that, when added to a field, property or parameter, throws an ArgumentOutOfRangeException if the target is assigned a value that is outside a given range.
Inheritance
Implements
Namespace: Metalama.Patterns.Contracts
Assembly: Metalama.Patterns.Contracts.dll
Syntax
public class RangeAttribute : ContractBaseAttribute, IAspect<IParameter>, IEligible<IParameter>, IAspect<IFieldOrPropertyOrIndexer>, IEligible<IFieldOrPropertyOrIndexer>, IConditionallyInheritableAspect, IAspect, ICompileTimeSerializable, ITemplateProvider
Remarks
Null values are accepted and do not throw an exception.
Error message can use additional argument
Constructors
Name | Description |
---|---|
RangeAttribute(Byte, SByte, Boolean, Boolean) | Initializes a new instance of the RangeAttribute class specifying bounds of type Byte. |
RangeAttribute(Double, Double, Boolean, Boolean) | Initializes a new instance of the RangeAttribute class specifying bounds of type Double. |
RangeAttribute(Int16, Int16, Boolean, Boolean) | Initializes a new instance of the RangeAttribute class specifying bounds of type Int16. |
RangeAttribute(Int32, Int32, Boolean, Boolean, Int32) | Initializes a new instance of the RangeAttribute class specifying bounds of type Int32. |
RangeAttribute(Int64, Int64, Boolean, Boolean, Int32) | Initializes a new instance of the RangeAttribute class specifying bounds of type Int64. |
RangeAttribute(Single, Single, Boolean, Boolean) | Initializes a new instance of the RangeAttribute class specifying bounds of type Single. |
RangeAttribute(UInt16, UInt16, Boolean, Boolean) | Initializes a new instance of the RangeAttribute class specifying bounds of type UInt16. |
RangeAttribute(UInt32, UInt32, Boolean, Boolean) | Initializes a new instance of the RangeAttribute class specifying bounds of type UInt32. |
RangeAttribute(UInt64, UInt64, Boolean, Boolean) | Initializes a new instance of the RangeAttribute class specifying bounds of type UInt64. |
Properties
Name | Description |
---|---|
Range |