PostSharp6.0/API Reference/Post­Sharp.​Aspects Namespace/ILocation­Validation­Aspect(T) Interface/ILocation­Validation­Aspect(T) Methods/ILocation­Validation­Aspect(T).​Validate­Value Method

ILocationValidationAspect<T>.ValidateValue Method

Validates the value being assigned to the location to which the current aspect has been applied.

Namespace:  PostSharp.Aspects
Assembly:  PostSharp (in PostSharp.dll) Version: 6.0.35.0 (6.0.35.0)
Syntax
C#
Exception ValidateValue(
	T value,
	string locationName,
	LocationKind locationKind,
	LocationValidationContext context
)

Parameters

value
Type: T
Value being applied to the location.
locationName
Type: System.String
Name of the location.
locationKind
Type: PostSharp.Reflection.LocationKind
Location kind (Field, Property, or Parameter).
context
Type: PostSharp.Aspects.LocationValidationContext
Indicates the context in which the value is being validated, such as precondition or postcondition for ref method parameters.

Return Value

Type: Exception
The Exception to be thrown, or null if no exception needs to be thrown.
See Also