Compartir a través de


ObjectModelValidator.Validate Método

Definición

Sobrecargas

Validate(ActionContext, ValidationStateDictionary, String, Object)

Valida el objeto proporcionado.

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

Valida el modelo de objetos proporcionado. Si model es null y el metadatade IsRequired es true, agregará uno o varios errores de estado del modelo que Validate(ActionContext, ValidationStateDictionary, String, Object) no lo harían.

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

Valida el modelo de objetos proporcionado. Si model es null y el metadatade IsRequired es true, agregará uno o varios errores de estado del modelo que Validate(ActionContext, ValidationStateDictionary, String, Object) no lo harían.

Validate(ActionContext, ValidationStateDictionary, String, Object)

Source:
ObjectModelValidator.cs
Source:
ObjectModelValidator.cs
Source:
ObjectModelValidator.cs

Valida el objeto proporcionado.

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

asociado ActionContext a la solicitud actual.

validationState
ValidationStateDictionary

ValidationStateDictionary. Su valor puede ser null.

prefix
String

Prefijo del modelo. Se usa para asignar el objeto de modelo a las entradas de validationState.

model
Object

Objeto del modelo.

Implementaciones

Se aplica a

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

Source:
ObjectModelValidator.cs
Source:
ObjectModelValidator.cs
Source:
ObjectModelValidator.cs

Valida el modelo de objetos proporcionado. Si model es null y el metadatade IsRequired es true, agregará uno o varios errores de estado del modelo que Validate(ActionContext, ValidationStateDictionary, String, Object) no lo harían.

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

ActionContext.

prefix
String

Clave de prefijo del modelo.

model
Object

Objeto del modelo.

Se aplica a

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

Source:
ObjectModelValidator.cs

Valida el modelo de objetos proporcionado. Si model es null y el metadatade IsRequired es true, agregará uno o varios errores de estado del modelo que Validate(ActionContext, ValidationStateDictionary, String, Object) no lo harían.

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

ActionContext.

prefix
String

Clave de prefijo del modelo.

model
Object

Objeto del modelo.

container
Object

El contenedor del modelo

Se aplica a