Open sandboxFocus

Method ValidateValue

ValidateValue(T, string, LocationKind, LocationValidationContext)

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

Declaration
[HasInheritedAttribute]
Exception ValidateValue(T value, string locationName, LocationKind locationKind, LocationValidationContext context)
Parameters
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.

Returns
Type Description
Exception

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