共用方式為


ObjectModelValidator.Validate 方法

定義

多載

Validate(ActionContext, ValidationStateDictionary, String, Object)

驗證提供的 物件。

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

驗證提供的物件模型。 如果 modelnullmetadataIsRequiredtrue ,將會新增一或多個不會的模型狀態錯誤 Validate(ActionContext, ValidationStateDictionary, String, Object)

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

驗證提供的物件模型。 如果 modelnullmetadataIsRequiredtrue ,將會新增一或多個不會的模型狀態錯誤 Validate(ActionContext, ValidationStateDictionary, String, Object)

Validate(ActionContext, ValidationStateDictionary, String, Object)

來源:
ObjectModelValidator.cs
來源:
ObjectModelValidator.cs
來源:
ObjectModelValidator.cs

驗證提供的 物件。

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)

參數

actionContext
ActionContext

ActionContext 目前要求相關聯的 。

validationState
ValidationStateDictionary

ValidationStateDictionary。 可能是 Null。

prefix
String

模型前置詞。 用來將模型物件對應至 中的 validationState 專案。

model
Object

模型物件。

實作

適用於

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

來源:
ObjectModelValidator.cs
來源:
ObjectModelValidator.cs
來源:
ObjectModelValidator.cs

驗證提供的物件模型。 如果 modelnullmetadataIsRequiredtrue ,將會新增一或多個不會的模型狀態錯誤 Validate(ActionContext, ValidationStateDictionary, String, Object)

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)

參數

actionContext
ActionContext

ActionContext

prefix
String

模型前置詞索引鍵。

model
Object

模型物件。

適用於

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

來源:
ObjectModelValidator.cs

驗證提供的物件模型。 如果 modelnullmetadataIsRequiredtrue ,將會新增一或多個不會的模型狀態錯誤 Validate(ActionContext, ValidationStateDictionary, String, Object)

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)

參數

actionContext
ActionContext

ActionContext

prefix
String

模型前置詞索引鍵。

model
Object

模型物件。

container
Object

模型容器

適用於