ValidationVisitor.Validate 方法

定义

重载

Validate(ModelMetadata, String, Object)

验证 对象。

Validate(ModelMetadata, String, Object, Boolean)

验证 对象。

Validate(ModelMetadata, String, Object, Boolean, Object)

验证 对象。

Validate(ModelMetadata, String, Object)

Source:
ValidationVisitor.cs
Source:
ValidationVisitor.cs
Source:
ValidationVisitor.cs

验证 对象。

public:
 bool Validate(Microsoft::AspNetCore::Mvc::ModelBinding::ModelMetadata ^ metadata, System::String ^ key, System::Object ^ model);
public bool Validate (Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata metadata, string key, object model);
member this.Validate : Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata * string * obj -> bool
Public Function Validate (metadata As ModelMetadata, key As String, model As Object) As Boolean

参数

metadata
ModelMetadata

ModelMetadata 模型关联的 。

key
String

模型前缀键。

model
Object

对象模型。

返回

true 如果对象有效,则为 ;否则为 false

适用于

Validate(ModelMetadata, String, Object, Boolean)

Source:
ValidationVisitor.cs
Source:
ValidationVisitor.cs
Source:
ValidationVisitor.cs

验证 对象。

public:
 virtual bool Validate(Microsoft::AspNetCore::Mvc::ModelBinding::ModelMetadata ^ metadata, System::String ^ key, System::Object ^ model, bool alwaysValidateAtTopLevel);
public virtual bool Validate (Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata metadata, string key, object model, bool alwaysValidateAtTopLevel);
public virtual bool Validate (Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata? metadata, string? key, object? model, bool alwaysValidateAtTopLevel);
abstract member Validate : Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata * string * obj * bool -> bool
override this.Validate : Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata * string * obj * bool -> bool
Public Overridable Function Validate (metadata As ModelMetadata, key As String, model As Object, alwaysValidateAtTopLevel As Boolean) As Boolean

参数

metadata
ModelMetadata

ModelMetadata 模型关联的 。

key
String

模型前缀键。

model
Object

对象模型。

alwaysValidateAtTopLevel
Boolean

如果 true为 ,则即使顶级值为 , null也会应用验证规则。

返回

true 如果对象有效,则为 ;否则为 false

适用于

Validate(ModelMetadata, String, Object, Boolean, Object)

Source:
ValidationVisitor.cs

验证 对象。

public:
 virtual bool Validate(Microsoft::AspNetCore::Mvc::ModelBinding::ModelMetadata ^ metadata, System::String ^ key, System::Object ^ model, bool alwaysValidateAtTopLevel, System::Object ^ container);
public virtual bool Validate (Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata metadata, string key, object model, bool alwaysValidateAtTopLevel, object container);
public virtual bool Validate (Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata? metadata, string? key, object? model, bool alwaysValidateAtTopLevel, object? container);
abstract member Validate : Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata * string * obj * bool * obj -> bool
override this.Validate : Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata * string * obj * bool * obj -> bool
Public Overridable Function Validate (metadata As ModelMetadata, key As String, model As Object, alwaysValidateAtTopLevel As Boolean, container As Object) As Boolean

参数

metadata
ModelMetadata

ModelMetadata 模型关联的 。

key
String

模型前缀键。

model
Object

对象模型。

alwaysValidateAtTopLevel
Boolean

如果 true为 ,则即使顶级值为 , null也会应用验证规则。

container
Object

模型容器。

返回

true 如果对象有效,则为 ;否则为 false

适用于