ValidationAttribute.IsValid ValidationAttribute.IsValid ValidationAttribute.IsValid ValidationAttribute.IsValid Method

Definition

Checks whether the specified object is valid.

Overloads

IsValid(Object) IsValid(Object) IsValid(Object) IsValid(Object)

Determines whether the specified value of the object is valid.

IsValid(Object, ValidationContext) IsValid(Object, ValidationContext) IsValid(Object, ValidationContext)

Validates the specified value with respect to the current validation attribute.

IsValid(Object) IsValid(Object) IsValid(Object) IsValid(Object)

Determines whether the specified value of the object is valid.

public:
 abstract bool IsValid(System::Object ^ value);
public abstract bool IsValid (object value);
abstract member IsValid : obj -> bool
Public MustOverride Function IsValid (value As Object) As Boolean

Parameters

value
Object Object Object Object

The value of the object to validate.

Returns

true if the specified value is valid; otherwise, false.

Exceptions

Neither overload of IsValid has been implemented by a derived class.

Remarks

If you inherit from the ValidationAttribute class, you must implement the validation logic in this method.

IsValid(Object, ValidationContext) IsValid(Object, ValidationContext) IsValid(Object, ValidationContext)

Validates the specified value with respect to the current validation attribute.

protected:
 virtual System::ComponentModel::DataAnnotations::ValidationResult ^ IsValid(System::Object ^ value, System::ComponentModel::DataAnnotations::ValidationContext ^ validationContext);
protected virtual System.ComponentModel.DataAnnotations.ValidationResult IsValid (object value, System.ComponentModel.DataAnnotations.ValidationContext validationContext);
abstract member IsValid : obj * System.ComponentModel.DataAnnotations.ValidationContext -> System.ComponentModel.DataAnnotations.ValidationResult
override this.IsValid : obj * System.ComponentModel.DataAnnotations.ValidationContext -> System.ComponentModel.DataAnnotations.ValidationResult

Parameters

value
Object Object Object Object

The value to validate.

validationContext
ValidationContext ValidationContext ValidationContext ValidationContext

The context information about the validation operation.

Returns

Exceptions

See also

Applies to