Bagikan melalui


ObjectModelValidator.Validate Metode

Definisi

Overload

Validate(ActionContext, ValidationStateDictionary, String, Object)

Memvalidasi objek yang disediakan.

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

Memvalidasi model objek yang disediakan. Jika model adalah null dan metadataadalah IsRequiredtrue, akan menambahkan satu atau beberapa kesalahan status model yang Validate(ActionContext, ValidationStateDictionary, String, Object) tidak akan ditambahkan.

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

Memvalidasi model objek yang disediakan. Jika model adalah null dan metadataadalah IsRequiredtrue, akan menambahkan satu atau beberapa kesalahan status model yang Validate(ActionContext, ValidationStateDictionary, String, Object) tidak akan ditambahkan.

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 metadataadalah 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

ActionContext.

prefix
String

Kunci awalan model.

model
Object

Objek model.

Berlaku untuk

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

Sumber:
ObjectModelValidator.cs

Memvalidasi model objek yang disediakan. Jika model adalah null dan metadataadalah 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

ActionContext.

prefix
String

Kunci awalan model.

model
Object

Objek model.

container
Object

Kontainer model

Berlaku untuk