Validates the specified object.
public void Validate(
The value of the object to validate.
The name to include in the error message.
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.