ObjectModelValidator.Validate 方法

定义

重载

Validate(ActionContext, ValidationStateDictionary, String, Object)

验证提供的对象。

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

验证提供的对象模型。 如果 modelnull ,而 metadataIsRequiredtrue,将添加一个或多个不会的 Validate(ActionContext, ValidationStateDictionary, String, Object) 模型状态错误。

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

验证提供的对象模型。 如果 modelnull ,而 metadataIsRequiredtrue,将添加一个或多个不会的 Validate(ActionContext, ValidationStateDictionary, String, Object) 模型状态错误。

Validate(ActionContext, ValidationStateDictionary, String, Object)

Source:
ObjectModelValidator.cs
Source:
ObjectModelValidator.cs
Source:
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)

Source:
ObjectModelValidator.cs
Source:
ObjectModelValidator.cs
Source:
ObjectModelValidator.cs

验证提供的对象模型。 如果 modelnull ,而 metadataIsRequiredtrue,将添加一个或多个不会的 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)

参数

prefix
String

模型前缀键。

model
Object

对象模型。

适用于

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

Source:
ObjectModelValidator.cs

验证提供的对象模型。 如果 modelnull ,而 metadataIsRequiredtrue,将添加一个或多个不会的 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)

参数

prefix
String

模型前缀键。

model
Object

对象模型。

container
Object

模型容器

适用于