Open sandboxFocus
  • TOC

Metalama Documentation

Getting started

Conceptual documentation

Commented examples

API documentation

Aspect API

Extensions API

Patterns API

Metalama.​Patterns.​Caching

Metalama.​Patterns.​Caching.​Aspects

Metalama.​Patterns.​Caching.​Aspects.​Configuration

Metalama.​Patterns.​Caching.​Aspects.​Helpers

Metalama.​Patterns.​Caching.​Backends

Metalama.​Patterns.​Caching.​Backends.​Azure

Metalama.​Patterns.​Caching.​Backends.​Redis

Metalama.​Patterns.​Caching.​Building

Metalama.​Patterns.​Caching.​Dependencies

Metalama.​Patterns.​Caching.​Formatters

Metalama.​Patterns.​Caching.​Implementation

Metalama.​Patterns.​Caching.​Locking

Metalama.​Patterns.​Caching.​Serializers

Metalama.​Patterns.​Caching.​Value­Adapters

Metalama.​Patterns.​Contracts

Metalama.​Patterns.​Contracts.​Numeric

Metalama.​Patterns.​Immutability

Metalama.​Patterns.​Immutability.​Configuration

Metalama.​Patterns.​Memoization

Metalama.​Patterns.​Observability

Metalama.​Patterns.​Observability.​Configuration

Metalama.​Patterns.​Observability.​Implementation

Metalama.​Patterns.​Wpf

Metalama.​Patterns.​Wpf.​Configuration

Flashtrace API

Introspection API

Advanced API

Post­Sharp API migration

  • Article

Class LessThanAttribute

Custom attribute that, when added to a field, property or parameter, throws an ArgumentOutOfRangeException if the target is assigned a value that is greater than a given bound. The behavior when the target is exactly assigned to the bound depends on the DefaultInequalityStrictness option. If this option is not specified, a warning is reported.

Namespace: Metalama.Patterns.Contracts
Assembly: Metalama.Patterns.Contracts.dll
Syntax
public class LessThanAttribute : RangeAttribute, 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 {4} to refer to the minimum value used.

Constructors

Name Description
LessThanAttribute(byte)

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

LessThanAttribute(decimal)

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

LessThanAttribute(double)

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

LessThanAttribute(short)

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

LessThanAttribute(int, int)

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

LessThanAttribute(long, int)

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

LessThanAttribute(sbyte)

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

LessThanAttribute(float)

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

LessThanAttribute(ushort)

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

LessThanAttribute(uint)

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

LessThanAttribute(ulong)

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

Methods

Name Description
OnContractViolated(dynamic?, NumericRange, ContractContext)

Extension Methods

See Also