Validator::ValidateValue Method (Object^, ValidationContext^, IEnumerable<ValidationAttribute^>^)
.NET Framework (current version)
Validates the specified attributes.
Assembly: System.ComponentModel.DataAnnotations (in System.ComponentModel.DataAnnotations.dll)
public: static void ValidateValue( Object^ value, ValidationContext^ validationContext, IEnumerable<ValidationAttribute^>^ validationAttributes )
Parameters
- value
-
Type:
System::Object^
The value to validate.
- validationContext
-
Type:
System.ComponentModel.DataAnnotations::ValidationContext^
The context that describes the object to validate.
- validationAttributes
-
Type:
System.Collections.Generic::IEnumerable<ValidationAttribute^>^
The validation attributes.
| Exception | Condition |
|---|---|
| ArgumentNullException | The validationContext parameter is null. |
| ValidationException | The value parameter does not validate with the validationAttributes parameter. |
This method tests each validation attribute in the validationAttributes parameter against the value parameter. If a RequiredAttribute attribute is included, the RequiredAttribute attribute is evaluated first.
Universal Windows Platform
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 3.0
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 3.0
Show: