ObjectModelValidator.Validate Metode
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Overload
Validate(ActionContext, ValidationStateDictionary, String, Object) |
Memvalidasi objek yang disediakan. |
Validate(ActionContext, ValidationStateDictionary, String, Object, ModelMetadata) |
Memvalidasi model objek yang disediakan.
Jika |
Validate(ActionContext, ValidationStateDictionary, String, Object, ModelMetadata, Object) |
Memvalidasi model objek yang disediakan.
Jika |
Validate(ActionContext, ValidationStateDictionary, String, Object)
- Sumber:
- ObjectModelValidator.cs
- Sumber:
- ObjectModelValidator.cs
- Sumber:
- ObjectModelValidator.cs
Memvalidasi objek yang disediakan.
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)
Parameter
- actionContext
- ActionContext
Yang ActionContext terkait dengan permintaan saat ini.
- validationState
- ValidationStateDictionary
ValidationStateDictionary. Mungkin null.
- prefix
- String
Awalan model. Digunakan untuk memetakan objek model ke entri di validationState
.
- model
- Object
Objek model.
Penerapan
Berlaku untuk
Validate(ActionContext, ValidationStateDictionary, String, Object, ModelMetadata)
- Sumber:
- ObjectModelValidator.cs
- Sumber:
- ObjectModelValidator.cs
- Sumber:
- ObjectModelValidator.cs
Memvalidasi model objek yang disediakan.
Jika model
adalah null
dan metadata
adalah IsRequiredtrue
, akan menambahkan satu atau beberapa kesalahan status model yang Validate(ActionContext, ValidationStateDictionary, String, Object) tidak akan ditambahkan.
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)
Parameter
- actionContext
- ActionContext
- validationState
- ValidationStateDictionary
- prefix
- String
Kunci awalan model.
- model
- Object
Objek model.
- metadata
- ModelMetadata
Berlaku untuk
Validate(ActionContext, ValidationStateDictionary, String, Object, ModelMetadata, Object)
- Sumber:
- ObjectModelValidator.cs
Memvalidasi model objek yang disediakan.
Jika model
adalah null
dan metadata
adalah IsRequiredtrue
, akan menambahkan satu atau beberapa kesalahan status model yang Validate(ActionContext, ValidationStateDictionary, String, Object) tidak akan ditambahkan.
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)
Parameter
- actionContext
- ActionContext
- validationState
- ValidationStateDictionary
- prefix
- String
Kunci awalan model.
- model
- Object
Objek model.
- metadata
- ModelMetadata
- container
- Object
Kontainer model