ValidationContext Classe

Definição

Descreve o contexto no qual é realizada uma verificação de validação.Describes the context in which a validation check is performed.

public ref class ValidationContext sealed : IServiceProvider
public sealed class ValidationContext : IServiceProvider
type ValidationContext = class
    interface IServiceProvider
Public NotInheritable Class ValidationContext
Implements IServiceProvider
Herança
ValidationContext
Implementações

Comentários

Essa classe descreve o tipo ou o membro no qual a validação é executada.This class describes the type or member on which validation is performed. Ele também permite que a validação personalizada seja adicionada por meio de qualquer serviço que implemente a IServiceProvider interface.It also enables custom validation to be added through any service that implements the IServiceProvider interface.

Construtores

ValidationContext(Object)

Inicializa uma nova instância da classe ValidationContext usando a instância do objeto especificado.Initializes a new instance of the ValidationContext class using the specified object instance.

ValidationContext(Object, IDictionary<Object,Object>)

Inicializa uma nova instância da classe ValidationContext usando o objeto especificado e um recipiente de propriedades opcional.Initializes a new instance of the ValidationContext class using the specified object and an optional property bag.

ValidationContext(Object, IServiceProvider, IDictionary<Object,Object>)

Inicializa uma nova instância da classe ValidationContext usando o provedor de serviços e o dicionário de consumidores do serviço.Initializes a new instance of the ValidationContext class using the service provider and dictionary of service consumers.

Propriedades

DisplayName

Obtém ou define o nome do membro a ser validado.Gets or sets the name of the member to validate.

Items

Obtém o dicionário de pares chave/valor associado a esse contexto.Gets the dictionary of key/value pairs that is associated with this context.

MemberName

Obtém ou define o nome do membro a ser validado.Gets or sets the name of the member to validate.

ObjectInstance

Obtém o objeto a ser validado.Gets the object to validate.

ObjectType

Obtém o tipo do objeto a ser validado.Gets the type of the object to validate.

ServiceContainer

Obtém o contêiner de serviços de validação.Gets the validation services container.

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)
GetService(Type)

Retorna o serviço que fornece a validação personalizada.Returns the service that provides custom validation.

GetType()

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

(Herdado de Object)
InitializeServiceProvider(Func<Type,Object>)

Inicializa o ValidationContext usando um provedor de serviço que pode retornar instâncias de serviço por tipo quando GetService(Type) é chamado.Initializes the ValidationContext using a service provider that can return service instances by type when GetService(Type) is called.

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)

Aplica-se a