Metalama 1.0 / / Metalama Documentation / Post­Sharp API Migration / Post­Sharp.​Constraints

Namespace PostSharp.Constraints

Classes

ComponentInternalAttribute

Not implemented yet in Metalama, but it will be.

Constraint

ExperimentalAttribute

Not implemented yet in Metalama, but it will be.

InternalImplementAttribute

Not implemented yet in Metalama, but it will be.

NamingConventionAttribute

Not implemented yet in Metalama, but it will be.

ParameterValueConstraint

Not implemented yet in Metalama, and there is currently no plan to do it.

ProtectedAttribute

Not implemented yet in Metalama, but it will be.

ReferenceConstraint

In Metalama, use an aspect or a fabric, and register a reference validator using the ValidateReferences(ValidatorDelegate<ReferenceValidationContext>, ReferenceKinds) method. For instance, from the BuildAspect(IAspectBuilder<T>) method of an aspect, call builder.With<TMember>(Func<TTarget, IEnumerable<TMember>>)(...).ValidateReferences(ValidatorDelegate<ReferenceValidationContext>, ReferenceKinds).

ReferentialConstraint

In Metalama, use an aspect or a fabric, and register a reference validator using the ValidateReferences(ValidatorDelegate<ReferenceValidationContext>, ReferenceKinds) method. For instance, from the BuildAspect(IAspectBuilder<T>) method of an aspect, call builder.With<TMember>(Func<TTarget, IEnumerable<TMember>>)(...).ValidateReferences(ValidatorDelegate<ReferenceValidationContext>, ReferenceKinds).

ScalarConstraint

Interfaces

IConstraint

In Metalama, use an aspect or a fabric, and register a reference validator using the ValidateReferences(ValidatorDelegate<ReferenceValidationContext>, ReferenceKinds) or Validate(ValidatorDelegate<DeclarationValidationContext>) method. For instance, from the BuildAspect(IAspectBuilder<T>) method of an aspect, call builder.With<TMember>(Func<TTarget, IEnumerable<TMember>>)(...).ValidateReferences(ValidatorDelegate<ReferenceValidationContext>, ReferenceKinds).

IReferentialConstraint

In Metalama, use an aspect or a fabric, and register a reference validator using the ValidateReferences(ValidatorDelegate<ReferenceValidationContext>, ReferenceKinds) method. For instance, from the BuildAspect(IAspectBuilder<T>) method of an aspect, call builder.With<TMember>(Func<TTarget, IEnumerable<TMember>>)(...).ValidateReferences(ValidatorDelegate<ReferenceValidationContext>, ReferenceKinds).

IScalarConstraint

In Metalama, use an aspect or a fabric, and register a reference validator using the Validate(ValidatorDelegate<DeclarationValidationContext>) method. For instance, from the BuildAspect(IAspectBuilder<T>) method of an aspect, call builder.With<TMember>(Func<TTarget, IEnumerable<TMember>>)(...).Validate(ValidatorDelegate<DeclarationValidationContext>).