PostSharp 4.3 / / Post­Sharp Documentation / API Reference / Post­Sharp.​Aspects.​Advices Namespace / Location­Validation­Advice Class
LocationValidationAdvice Class
Custom attribute that, when applied on a method of an aspect class, specifies that this method has the same semantic as the ValidateValue(T, String, LocationKind) method of the ILocationValidationAspect<T> interface.
Inheritance Hierarchy

Namespace: PostSharp.Aspects.Advices
Assembly: PostSharp (in PostSharp.dll) Version: (
public class LocationValidationAdvice : GroupingAdvice

The LocationValidationAdvice type exposes the following members.

Public methodLocationValidationAdvice
Initializes a new instance of the LocationValidationAdvice class
Public propertyDescription
A human-readable description of the current advice.
(Inherited from Advice.)
Public propertyLinesOfCodeAvoided
Reduction in the code lines count achieved by applying the advice instance to one code element.
(Inherited from Advice.)
Public propertyMaster
Name of the master advice method. If this property is not set, the current method is itself the master of the group. Only master methods can define selectors (Pointcut) and dependencies (AspectDependencyAttribute).
(Inherited from GroupingAdvice.)
Extension Methods
Public Extension MethodQueryInterface<T>
Gets the implementation of a specified interface for the specified object.
(Defined by QueryInterfaceExtensions.)

The method to which this custom attribute is applied must be public and must have the same signature as ValidateValue(T, String, LocationKind), where T can be any type. However, the method can be static.

The method can also have an additional parameter of type LocationValidationContext. Advice methods with this parameter can be used to validate postconditions as well as preconditions.

See Also