Partilhar via


ObjectModelValidator.Validate Método

Definição

Sobrecargas

Validate(ActionContext, ValidationStateDictionary, String, Object)

Valida o objeto fornecido.

Validate(ActionContext, ValidationStateDictionary, String, Object, ModelMetadata)

Valida o modelo de objeto fornecido. Se model for null e o metadatade IsRequired for true, adicionará um ou mais erros de estado do modelo que Validate(ActionContext, ValidationStateDictionary, String, Object) não o fariam.

Validate(ActionContext, ValidationStateDictionary, String, Object, ModelMetadata, Object)

Valida o modelo de objeto fornecido. Se model for null e o metadatade IsRequired for true, adicionará um ou mais erros de estado do modelo que Validate(ActionContext, ValidationStateDictionary, String, Object) não o fariam.

Validate(ActionContext, ValidationStateDictionary, String, Object)

Origem:
ObjectModelValidator.cs
Origem:
ObjectModelValidator.cs
Origem:
ObjectModelValidator.cs

Valida o objeto fornecido.

public:
 virtual void Validate(Microsoft::AspNetCore::Mvc::ActionContext ^ actionContext, Microsoft::AspNetCore::Mvc::ModelBinding::Validation::ValidationStateDictionary ^ validationState, System::String ^ prefix, System::Object ^ model);
public virtual void Validate (Microsoft.AspNetCore.Mvc.ActionContext actionContext, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateDictionary validationState, string prefix, object model);
public virtual void Validate (Microsoft.AspNetCore.Mvc.ActionContext actionContext, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateDictionary? validationState, string? prefix, object? model);
abstract member Validate : Microsoft.AspNetCore.Mvc.ActionContext * Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateDictionary * string * obj -> unit
override this.Validate : Microsoft.AspNetCore.Mvc.ActionContext * Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateDictionary * string * obj -> unit
Public Overridable Sub Validate (actionContext As ActionContext, validationState As ValidationStateDictionary, prefix As String, model As Object)

Parâmetros

actionContext
ActionContext

O ActionContext associado à solicitação atual.

validationState
ValidationStateDictionary

O ValidationStateDictionary. Pode ser nulo.

prefix
String

O prefixo do modelo. Usado para mapear o objeto de modelo para entradas no validationState.

model
Object

O objeto de modelo.

Implementações

Aplica-se a

Validate(ActionContext, ValidationStateDictionary, String, Object, ModelMetadata)

Origem:
ObjectModelValidator.cs
Origem:
ObjectModelValidator.cs
Origem:
ObjectModelValidator.cs

Valida o modelo de objeto fornecido. Se model for null e o metadatade IsRequired for true, adicionará um ou mais erros de estado do modelo que Validate(ActionContext, ValidationStateDictionary, String, Object) não o fariam.

public:
 virtual void Validate(Microsoft::AspNetCore::Mvc::ActionContext ^ actionContext, Microsoft::AspNetCore::Mvc::ModelBinding::Validation::ValidationStateDictionary ^ validationState, System::String ^ prefix, System::Object ^ model, Microsoft::AspNetCore::Mvc::ModelBinding::ModelMetadata ^ metadata);
public virtual void Validate (Microsoft.AspNetCore.Mvc.ActionContext actionContext, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateDictionary validationState, string prefix, object model, Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata metadata);
public virtual void Validate (Microsoft.AspNetCore.Mvc.ActionContext actionContext, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateDictionary? validationState, string? prefix, object? model, Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata metadata);
abstract member Validate : Microsoft.AspNetCore.Mvc.ActionContext * Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateDictionary * string * obj * Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata -> unit
override this.Validate : Microsoft.AspNetCore.Mvc.ActionContext * Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateDictionary * string * obj * Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata -> unit
Public Overridable Sub Validate (actionContext As ActionContext, validationState As ValidationStateDictionary, prefix As String, model As Object, metadata As ModelMetadata)

Parâmetros

actionContext
ActionContext

O ActionContext.

prefix
String

A chave de prefixo do modelo.

model
Object

O objeto de modelo.

Aplica-se a

Validate(ActionContext, ValidationStateDictionary, String, Object, ModelMetadata, Object)

Origem:
ObjectModelValidator.cs

Valida o modelo de objeto fornecido. Se model for null e o metadatade IsRequired for true, adicionará um ou mais erros de estado do modelo que Validate(ActionContext, ValidationStateDictionary, String, Object) não o fariam.

public:
 virtual void Validate(Microsoft::AspNetCore::Mvc::ActionContext ^ actionContext, Microsoft::AspNetCore::Mvc::ModelBinding::Validation::ValidationStateDictionary ^ validationState, System::String ^ prefix, System::Object ^ model, Microsoft::AspNetCore::Mvc::ModelBinding::ModelMetadata ^ metadata, System::Object ^ container);
public virtual void Validate (Microsoft.AspNetCore.Mvc.ActionContext actionContext, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateDictionary validationState, string prefix, object model, Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata metadata, object container);
public virtual void Validate (Microsoft.AspNetCore.Mvc.ActionContext actionContext, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateDictionary? validationState, string? prefix, object? model, Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata metadata, object? container);
abstract member Validate : Microsoft.AspNetCore.Mvc.ActionContext * Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateDictionary * string * obj * Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata * obj -> unit
override this.Validate : Microsoft.AspNetCore.Mvc.ActionContext * Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateDictionary * string * obj * Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata * obj -> unit
Public Overridable Sub Validate (actionContext As ActionContext, validationState As ValidationStateDictionary, prefix As String, model As Object, metadata As ModelMetadata, container As Object)

Parâmetros

actionContext
ActionContext

O ActionContext.

prefix
String

A chave de prefixo do modelo.

model
Object

O objeto de modelo.

container
Object

O contêiner de modelo

Aplica-se a