Open sandboxFocus
  • TOC

Metalama Documentation

Getting started

Video tutorials

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 LessThanOrEqualAttribute

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 value.

Namespace: Metalama.Patterns.Contracts
Assembly: Metalama.Patterns.Contracts.dll
Syntax
public class LessThanOrEqualAttribute : 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
LessThanOrEqualAttribute(byte)

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

LessThanOrEqualAttribute(decimal)

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

LessThanOrEqualAttribute(double)

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

LessThanOrEqualAttribute(short)

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

LessThanOrEqualAttribute(int, int)

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

LessThanOrEqualAttribute(long, int)

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

LessThanOrEqualAttribute(sbyte)

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

LessThanOrEqualAttribute(float)

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

LessThanOrEqualAttribute(ushort)

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

LessThanOrEqualAttribute(uint)

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

LessThanOrEqualAttribute(ulong)

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

Methods

Name Description
OnContractViolated(dynamic?, NumericRange, ContractContext)

Extension Methods

See Also