PageModel.TryValidateModel 方法

定义

重载

TryValidateModel(Object)

验证指定的 model 实例。

TryValidateModel(Object, String)

验证指定的 model 实例。

TryValidateModel(Object)

Source:
PageModel.cs
Source:
PageModel.cs
Source:
PageModel.cs

验证指定的 model 实例。

public:
 virtual bool TryValidateModel(System::Object ^ model);
public virtual bool TryValidateModel (object model);
abstract member TryValidateModel : obj -> bool
override this.TryValidateModel : obj -> bool
Public Overridable Function TryValidateModel (model As Object) As Boolean

参数

model
Object

要验证的模型。

返回

true 如果 有效, ModelState 则为 ; false 否则为 。

适用于

TryValidateModel(Object, String)

Source:
PageModel.cs
Source:
PageModel.cs
Source:
PageModel.cs

验证指定的 model 实例。

public:
 virtual bool TryValidateModel(System::Object ^ model, System::String ^ name);
public virtual bool TryValidateModel (object model, string name);
public virtual bool TryValidateModel (object model, string? name);
abstract member TryValidateModel : obj * string -> bool
override this.TryValidateModel : obj * string -> bool
Public Overridable Function TryValidateModel (model As Object, name As String) As Boolean

参数

model
Object

要验证的模型。

name
String

在 中 ModelState查找信息时要使用的键。

返回

true 如果 有效, ModelState 则为 ;false 否则为 。

适用于