Validator.ValidateValue(Object, ValidationContext, IEnumerable<ValidationAttribute>) Validator.ValidateValue(Object, ValidationContext, IEnumerable<ValidationAttribute>) Validator.ValidateValue(Object, ValidationContext, IEnumerable<ValidationAttribute>) Method

Definition

Validates the specified attributes.

public:
 static void ValidateValue(System::Object ^ value, System::ComponentModel::DataAnnotations::ValidationContext ^ validationContext, System::Collections::Generic::IEnumerable<System::ComponentModel::DataAnnotations::ValidationAttribute ^> ^ validationAttributes);
public static void ValidateValue (object value, System.ComponentModel.DataAnnotations.ValidationContext validationContext, System.Collections.Generic.IEnumerable<System.ComponentModel.DataAnnotations.ValidationAttribute> validationAttributes);
static member ValidateValue : obj * System.ComponentModel.DataAnnotations.ValidationContext * seq<System.ComponentModel.DataAnnotations.ValidationAttribute> -> unit

Parameters

value
Object Object Object

The value to validate.

validationContext
ValidationContext ValidationContext ValidationContext

The context that describes the object to validate.

validationAttributes
IEnumerable<ValidationAttribute>

The validation attributes.

Exceptions

The validationContext parameter is null.

The value parameter does not validate with the validationAttributes parameter.

Remarks

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.

Applies to