ValidationAttribute.Validate Method (Object, String)
.NET Framework (current version)
Validates the specified object.
Assembly: System.ComponentModel.DataAnnotations (in System.ComponentModel.DataAnnotations.dll)
Parameters
- value
-
Type:
System.Object
The value of the object to validate.
- name
-
Type:
System.String
The name to include in the error message.
| Exception | Condition |
|---|---|
| ValidationException | value is not valid. |
This method validates the value of the object or property on which the ValidationAttribute attribute is declared. It calls the IsValid method and passes value as a parameter. If validation fails, a ValidationException exception is thrown.
Universal Windows Platform
Available since 10
.NET Framework
Available since 3.5
Available since 10
.NET Framework
Available since 3.5
Show: