Validator.ValidateProperty(Object, ValidationContext) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Validates the property.
public:
static void ValidateProperty(System::Object ^ value, System::ComponentModel::DataAnnotations::ValidationContext ^ validationContext);
public static void ValidateProperty(object value, System.ComponentModel.DataAnnotations.ValidationContext validationContext);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of validationContext.ObjectType cannot be statically discovered.")]
public static void ValidateProperty(object? value, System.ComponentModel.DataAnnotations.ValidationContext validationContext);
public static void ValidateProperty(object? value, System.ComponentModel.DataAnnotations.ValidationContext validationContext);
static member ValidateProperty : obj * System.ComponentModel.DataAnnotations.ValidationContext -> unit
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of validationContext.ObjectType cannot be statically discovered.")>]
static member ValidateProperty : obj * System.ComponentModel.DataAnnotations.ValidationContext -> unit
Public Shared Sub ValidateProperty (value As Object, validationContext As ValidationContext)
Parameters
- value
- Object
The value to validate.
- validationContext
- ValidationContext
The context that describes the property to validate.
- Attributes
Exceptions
value cannot be assigned to the property.
The value parameter is not valid.
Remarks
This method tests each ValidationAttribute instance that is associated with the property identified by the validationContext parameter.