Bagikan melalui


ControllerBase.TryValidateModel Metode

Definisi

Overload

TryValidateModel(Object)

Memvalidasi instans yang ditentukan model .

TryValidateModel(Object, String)

Memvalidasi instans yang ditentukan model .

TryValidateModel(Object)

Sumber:
ControllerBase.cs
Sumber:
ControllerBase.cs
Sumber:
ControllerBase.cs

Memvalidasi instans yang ditentukan model .

public:
 virtual bool TryValidateModel(System::Object ^ model);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual bool TryValidateModel (object model);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member TryValidateModel : obj -> bool
override this.TryValidateModel : obj -> bool
Public Overridable Function TryValidateModel (model As Object) As Boolean

Parameter

model
Object

Model yang akan divalidasi.

Mengembalikan

true ModelState jika valid; false jika tidak.

Atribut

Berlaku untuk

TryValidateModel(Object, String)

Sumber:
ControllerBase.cs
Sumber:
ControllerBase.cs
Sumber:
ControllerBase.cs

Memvalidasi instans yang ditentukan model .

public:
 virtual bool TryValidateModel(System::Object ^ model, System::String ^ prefix);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual bool TryValidateModel (object model, string prefix);
[Microsoft.AspNetCore.Mvc.NonAction]
public virtual bool TryValidateModel (object model, string? prefix);
[<Microsoft.AspNetCore.Mvc.NonAction>]
abstract member TryValidateModel : obj * string -> bool
override this.TryValidateModel : obj * string -> bool
Public Overridable Function TryValidateModel (model As Object, prefix As String) As Boolean

Parameter

model
Object

Model yang akan divalidasi.

prefix
String

Kunci yang digunakan saat mencari informasi di ModelState.

Mengembalikan

true ModelState jika valid;false jika tidak.

Atribut

Berlaku untuk