ControllerBase.TryValidateModel ControllerBase.TryValidateModel ControllerBase.TryValidateModel Method

Definition

Overloads

TryValidateModel(Object) TryValidateModel(Object) TryValidateModel(Object)

Validates the specified model instance.

TryValidateModel(Object, String) TryValidateModel(Object, String) TryValidateModel(Object, String)

Validates the specified model instance.

TryValidateModel(Object) TryValidateModel(Object) TryValidateModel(Object)

Validates the specified model instance.

[Microsoft.AspNetCore.Mvc.NonAction]
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

Parameters

model
Object Object Object

The model to validate.

Returns

true if the ModelState is valid; false otherwise.

TryValidateModel(Object, String) TryValidateModel(Object, String) TryValidateModel(Object, String)

Validates the specified model instance.

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

Parameters

model
Object Object Object

The model to validate.

prefix
String String String

The key to use when looking up information in ModelState.

Returns

true if the ModelState is valid;false otherwise.

Applies to