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 value.
Inheritance
Namespace: PostSharp.Patterns.Contracts
Assembly: PostSharp.Patterns.Common.dll
Syntax
public class GreaterThanAttribute : RangeAttribute, ILocationLevelAspect, IValidableAnnotation, IAspectRemarks
Null values are accepted and do not throw an exception.
The error message is identified by GreaterThanErrorMessage.
The error message can use the additional argument {4} to refer to the minimum value used.
Constructors
| Name | Description |
|---|---|
| GreaterThanAttribute(double) | Initializes a new instance of the GreaterThanAttribute class with a given floating-point bound. |
| GreaterThanAttribute(long) | Initializes a new instance of the GreaterThanAttribute class with a given integer bound. |
| GreaterThanAttribute(ulong) | Initializes a new instance of the GreaterThanAttribute class with a given ulong bound. |
Methods
| Name | Description |
|---|---|
| CreateException(object, string, LocationKind, LocationValidationContext) | |
| GetErrorMessage() | Gets the unformatted error message as defined by the instance. |
| GetErrorMessageArguments() | Gets the values of the additional arguments for the error message associated with a particular instance of LocationContractAttribute.
These arguments can be referenced from the error message string by |