DataAnnotationsModelValidator Classe

Definição

Fornece um validador de modelo.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
Herança
DataAnnotationsModelValidator
Derivado

Construtores

DataAnnotationsModelValidator(ModelMetadata, ModelBindingExecutionContext, ValidationAttribute)

Inicializa uma nova instância da classe DataAnnotationsModelValidator.Initializes a new instance of the DataAnnotationsModelValidator class.

Propriedades

Attribute

Obtém o atributo de validação para o validador do modelo.Gets the validation attribute for the model validator.

ErrorMessage

Obtém a mensagem de erro para uma falha de validação.Gets the error message for a validation failure.

IsRequired

Obtém um valor que indica se o modelo é necessário (ou seja, se o atributo de validação na propriedade Attribute é um atributo RequiredAttribute).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

Quando implementado em uma classe derivada, obtém os metadados para o validador de modelo.When implemented in a derived class, gets the metadata for the model validator.

(Herdado de ModelValidator)
ModelBindingExecutionContext

Quando implementado em uma classe derivada, obtém o contexto de execução.When implemented in a derived class, gets the execution context.

(Herdado de ModelValidator)

Métodos

Equals(Object)

Determina se o objeto especificado é igual ao objeto atual.Determines whether the specified object is equal to the current object.

(Herdado de Object)
GetHashCode()

Serve como a função de hash padrão.Serves as the default hash function.

(Herdado de Object)
GetLocalizedErrorMessage(String)

Obtém uma mensagem de erro localizada para o modelo.Gets a localized error message for the model.

GetLocalizedString(String, Object[])

Obtém uma versão localizada de uma cadeia de caracteres específica.Gets a localized version for a specific string.

GetType()

Obtém o Type da instância atual.Gets the Type of the current instance.

(Herdado de Object)
MemberwiseClone()

Cria uma cópia superficial do Object atual.Creates a shallow copy of the current Object.

(Herdado de Object)
ToString()

Retorna uma cadeia de caracteres que representa o objeto atual.Returns a string that represents the current object.

(Herdado de Object)
Validate(Object)

Retorna uma lista de mensagens de erro de validação para o modelo.Returns a list of validation error messages for the model.

Aplica-se a