ObjectModelValidator.Validate Metoda
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Přetížení
Validate(ActionContext, ValidationStateDictionary, String, Object) |
Ověří zadaný objekt. |
Validate(ActionContext, ValidationStateDictionary, String, Object, ModelMetadata) |
Ověří zadaný objektový model.
Pokud |
Validate(ActionContext, ValidationStateDictionary, String, Object, ModelMetadata, Object) |
Ověří zadaný objektový model.
Pokud |
Validate(ActionContext, ValidationStateDictionary, String, Object)
- Zdroj:
- ObjectModelValidator.cs
- Zdroj:
- ObjectModelValidator.cs
- Zdroj:
- ObjectModelValidator.cs
Ověří zadaný objekt.
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)
Parametry
- actionContext
- ActionContext
Přidružený ActionContext k aktuálnímu požadavku.
- validationState
- ValidationStateDictionary
Hodnota ValidationStateDictionary Může mít hodnotu null.
- prefix
- String
Předpona modelu. Slouží k mapování objektu modelu na položky v validationState
.
- model
- Object
Objekt modelu.
Implementuje
Platí pro
Validate(ActionContext, ValidationStateDictionary, String, Object, ModelMetadata)
- Zdroj:
- ObjectModelValidator.cs
- Zdroj:
- ObjectModelValidator.cs
- Zdroj:
- ObjectModelValidator.cs
Ověří zadaný objektový model.
Pokud model
je null
a metadata
je IsRequiredtrue
, přidá jednu nebo více chyb stavu modelu, které Validate(ActionContext, ValidationStateDictionary, String, Object) by nebyly.
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)
Parametry
- actionContext
- ActionContext
Hodnota ActionContext
- validationState
- ValidationStateDictionary
Hodnota ValidationStateDictionary
- prefix
- String
Klíč předpony modelu.
- model
- Object
Objekt modelu.
- metadata
- ModelMetadata
Hodnota ModelMetadata
Platí pro
Validate(ActionContext, ValidationStateDictionary, String, Object, ModelMetadata, Object)
- Zdroj:
- ObjectModelValidator.cs
Ověří zadaný objektový model.
Pokud model
je null
a metadata
je IsRequiredtrue
, přidá jednu nebo více chyb stavu modelu, které Validate(ActionContext, ValidationStateDictionary, String, Object) by nebyly.
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)
Parametry
- actionContext
- ActionContext
Hodnota ActionContext
- validationState
- ValidationStateDictionary
Hodnota ValidationStateDictionary
- prefix
- String
Klíč předpony modelu.
- model
- Object
Objekt modelu.
- metadata
- ModelMetadata
Hodnota ModelMetadata
- container
- Object
Kontejner modelu