PostSharpAPI ReferencePost­Sharp.​AspectsILocation­Validation­Aspect<T>Validate­Value
Open sandboxFocus

ILocationValidationAspect<T>.ValidateValue Method

ValidateValue(T, String, LocationKind, LocationValidationContext)

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

Exception ValidateValue(T value, string locationName, LocationKind locationKind, LocationValidationContext context)
Type Name Description
T value

Value being applied to the location.

String locationName

Name of the location.

LocationKind locationKind

Location kind (Field, Property, or Parameter).

LocationValidationContext context

Indicates the context in which the value is being validated, such as precondition or postcondition for ref method parameters.

Type Description

The Exception to be thrown, or null if no exception needs to be thrown.