Partager via


ObjectModelValidator.Validate Méthode

Définition

Surcharges

Validate(ActionContext, ValidationStateDictionary, String, Object)

Valide l’objet fourni.

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

Valide le modèle objet fourni. Si model est null et que le metadataest IsRequiredtrue, ajoute une ou plusieurs erreurs d’état de modèle qui Validate(ActionContext, ValidationStateDictionary, String, Object) ne le seraient pas.

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

Valide le modèle objet fourni. Si model est null et que le metadataest IsRequiredtrue, ajoute une ou plusieurs erreurs d’état de modèle qui Validate(ActionContext, ValidationStateDictionary, String, Object) ne le seraient pas.

Validate(ActionContext, ValidationStateDictionary, String, Object)

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

Valide l’objet fourni.

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)

Paramètres

actionContext
ActionContext

ActionContext associé à la requête actuelle.

validationState
ValidationStateDictionary

L’ValidationStateDictionaryopérateur Ce paramètre peut être null.

prefix
String

Préfixe de modèle. Utilisé pour mapper l’objet de modèle aux entrées dans validationState.

model
Object

Objet du modèle.

Implémente

S’applique à

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

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

Valide le modèle objet fourni. Si model est null et que le metadataest IsRequiredtrue, ajoute une ou plusieurs erreurs d’état de modèle qui Validate(ActionContext, ValidationStateDictionary, String, Object) ne le seraient pas.

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)

Paramètres

actionContext
ActionContext

L’ActionContextopérateur

prefix
String

Clé de préfixe de modèle.

model
Object

Objet du modèle.

metadata
ModelMetadata

L’ModelMetadataopérateur

S’applique à

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

Source:
ObjectModelValidator.cs

Valide le modèle objet fourni. Si model est null et que le metadataest IsRequiredtrue, ajoute une ou plusieurs erreurs d’état de modèle qui Validate(ActionContext, ValidationStateDictionary, String, Object) ne le seraient pas.

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)

Paramètres

actionContext
ActionContext

L’ActionContextopérateur

prefix
String

Clé de préfixe de modèle.

model
Object

Objet du modèle.

metadata
ModelMetadata

L’ModelMetadataopérateur

container
Object

Conteneur de modèle

S’applique à