Post­Sharp Documentation / API Reference / Post­Sharp.​Constraints Namespace / IConstraint Interface

IConstraint Interface

A constraint is a piece of validation logic executed at build time. Constraints are applied to elements of code (Assembly, Type, MethodInfo, ConstructorInfo, PropertyInfo, EventInfo, FieldInfo, ParameterInfo), typically (but not necessarily) using custom attributes or MulticastAttribute.

Namespace:  PostSharp.Constraints
Assembly:  PostSharp (in PostSharp.dll) Version: 5.0.51.0 (5.0.51.0)
Syntax
C#
public interface IConstraint

The IConstraint type exposes the following members.

Methods
  NameDescription
Public methodValidateConstraint
Validates the fact that the constraint has been applied on a valid element of code. When this method returns false, the constraint is silently ignored.
Remarks
See Also