PostSharpAPI ReferencePost­Sharp.​ConstraintsIConstraint
Open sandboxFocus

IConstraint Interface

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

Namespace: PostSharp.Constraints
Assembly: PostSharp.dll
Syntax
[RequirePostSharp(null, "ArchitectureConstraint")]
public interface IConstraint

Methods

Name Description
ValidateConstraint(Object)

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.