Post­Sharp Documentation / API Reference / Post­Sharp.​Constraints Namespace / Parameter­Value­Constraint Class / Parameter­Value­Constraint Methods / Parameter­Value­Constraint.​Validate­Target­Parameter Method

ParameterValueConstraint.ValidateTargetParameter Method

Validates the parameter to which the current constraint has been applied. A typical use of this method is to validate the parameter type. Overriding implementations should call the base implementation.

Namespace:  PostSharp.Constraints
Assembly:  PostSharp (in PostSharp.dll) Version: (
protected virtual bool ValidateTargetParameter(
	ParameterInfo parameter


Type: System.Reflection.ParameterInfo
The parameter to which the custom attribute has been applied.

Return Value

Type: Boolean
true if the current constraint can legally be applied to parameter, false otherwise. No error message is emitted if the method returns false. The method should emit its own error message.
See Also