Validator Class
Microsoft Silverlight will reach end of support after October 2021. Learn more.
Provides members to help validate objects and members using values from the associated ValidationAttribute attribute.
Inheritance Hierarchy
System.Object
System.ComponentModel.DataAnnotations.Validator
Namespace: System.ComponentModel.DataAnnotations
Assembly: System.ComponentModel.DataAnnotations (in System.ComponentModel.DataAnnotations.dll)
Syntax
'Declaration
Public NotInheritable Class Validator
public static class Validator
The Validator type exposes the following members.
Methods
Name | Description | |
---|---|---|
TryValidateObject(Object, ValidationContext, ICollection<ValidationResult>) | Determines whether the specified object is valid. | |
TryValidateObject(Object, ValidationContext, ICollection<ValidationResult>, Boolean) | Determines whether the specified object is valid and, if requested, validates all of the properties of the object. | |
TryValidateProperty | Determines whether the specified property value is valid. | |
TryValidateValue | Determines whether a specified value is valid against a collection of validation attributes. | |
ValidateObject(Object, ValidationContext) | Determines whether the specified object is valid and throws a ValidationException if the object is not valid. | |
ValidateObject(Object, ValidationContext, Boolean) | Determines whether the specified object is valid and, if requested, whether all of the properties on the object are valid, and throws a ValidationException if the object is not valid. | |
ValidateProperty | Determines whether the specified property value is valid and throws a ValidationException if the property is not valid. | |
ValidateValue | Determines whether a specified value is valid against a collection of validation attributes and throws a ValidationException if the value is not valid. |
Top
Version Information
Silverlight
Supported in: 5, 4, 3
Platforms
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also