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: 2023.0.3.0 (2023.0.3.0)
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: ExceptionThe Exception to be thrown, or null if no exception needs to be thrown.