DataAnnotationsModelValidator DataAnnotationsModelValidator DataAnnotationsModelValidator DataAnnotationsModelValidator Class

Definition

Provides a model validator.

public ref class DataAnnotationsModelValidator : System::Web::ModelBinding::ModelValidator
public class DataAnnotationsModelValidator : System.Web.ModelBinding.ModelValidator
type DataAnnotationsModelValidator = class
    inherit ModelValidator
Public Class DataAnnotationsModelValidator
Inherits ModelValidator
Inheritance
DataAnnotationsModelValidatorDataAnnotationsModelValidatorDataAnnotationsModelValidatorDataAnnotationsModelValidator
Derived

Constructors

DataAnnotationsModelValidator(ModelMetadata, ModelBindingExecutionContext, ValidationAttribute) DataAnnotationsModelValidator(ModelMetadata, ModelBindingExecutionContext, ValidationAttribute) DataAnnotationsModelValidator(ModelMetadata, ModelBindingExecutionContext, ValidationAttribute) DataAnnotationsModelValidator(ModelMetadata, ModelBindingExecutionContext, ValidationAttribute)

Initializes a new instance of the DataAnnotationsModelValidator class.

Properties

Attribute Attribute Attribute Attribute

Gets the validation attribute for the model validator.

ErrorMessage ErrorMessage ErrorMessage ErrorMessage

Gets the error message for a validation failure.

IsRequired IsRequired IsRequired IsRequired

Gets a value that indicates whether the model is required (that is, whether the validation attribute in the Attribute property is a RequiredAttribute attribute).

Metadata Metadata Metadata Metadata

When implemented in a derived class, gets the metadata for the model validator.

(Inherited from ModelValidator)
ModelBindingExecutionContext ModelBindingExecutionContext ModelBindingExecutionContext ModelBindingExecutionContext

When implemented in a derived class, gets the execution context.

(Inherited from ModelValidator)

Methods

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetLocalizedErrorMessage(String) GetLocalizedErrorMessage(String) GetLocalizedErrorMessage(String) GetLocalizedErrorMessage(String)

Gets a localized error message for the model.

GetLocalizedString(String, Object[]) GetLocalizedString(String, Object[]) GetLocalizedString(String, Object[]) GetLocalizedString(String, Object[])

Gets a localized version for a specific string.

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)
Validate(Object) Validate(Object) Validate(Object) Validate(Object)

Returns a list of validation error messages for the model.

Applies to