共用方式為


ModelValidationContext 建構函式

定義

建立 ModelValidationContext 的新執行個體。

public:
 ModelValidationContext(Microsoft::AspNetCore::Mvc::ActionContext ^ actionContext, Microsoft::AspNetCore::Mvc::ModelBinding::ModelMetadata ^ modelMetadata, Microsoft::AspNetCore::Mvc::ModelBinding::IModelMetadataProvider ^ metadataProvider, System::Object ^ container, System::Object ^ model);
public ModelValidationContext (Microsoft.AspNetCore.Mvc.ActionContext actionContext, Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata modelMetadata, Microsoft.AspNetCore.Mvc.ModelBinding.IModelMetadataProvider metadataProvider, object container, object model);
public ModelValidationContext (Microsoft.AspNetCore.Mvc.ActionContext actionContext, Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata modelMetadata, Microsoft.AspNetCore.Mvc.ModelBinding.IModelMetadataProvider metadataProvider, object? container, object? model);
new Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ModelValidationContext : Microsoft.AspNetCore.Mvc.ActionContext * Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata * Microsoft.AspNetCore.Mvc.ModelBinding.IModelMetadataProvider * obj * obj -> Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ModelValidationContext
Public Sub New (actionContext As ActionContext, modelMetadata As ModelMetadata, metadataProvider As IModelMetadataProvider, container As Object, model As Object)

參數

actionContext
ActionContext

ActionContext用於驗證的 。

modelMetadata
ModelMetadata

ModelMetadata用於驗證的 。

metadataProvider
IModelMetadataProvider

IModelMetadataProvider要用於驗證的 。

container
Object

模型容器。

model
Object

要驗證的模型。

適用於