ObjectModelValidator.Validate Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Surcharges
Validate(ActionContext, ValidationStateDictionary, String, Object) |
Valide l’objet fourni. |
Validate(ActionContext, ValidationStateDictionary, String, Object, ModelMetadata) |
Valide le modèle objet fourni.
Si |
Validate(ActionContext, ValidationStateDictionary, String, Object, ModelMetadata, Object) |
Valide le modèle objet fourni.
Si |
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 metadata
est 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
- validationState
- ValidationStateDictionary
L’ValidationStateDictionaryopé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 metadata
est 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
- validationState
- ValidationStateDictionary
L’ValidationStateDictionaryopé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