Dela via


ValidationVisitor.Validate Method

Definition

Overloads

Validate(ModelMetadata, String, Object)

Validates a object.

Validate(ModelMetadata, String, Object, Boolean)

Validates a object.

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

Validates a object.

Validate(ModelMetadata, String, Object)

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

Validates a object.

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

Parameters

metadata
ModelMetadata

The ModelMetadata associated with the model.

key
String

The model prefix key.

model
Object

The model object.

Returns

true if the object is valid, otherwise false.

Applies to

Validate(ModelMetadata, String, Object, Boolean)

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

Validates a object.

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

Parameters

metadata
ModelMetadata

The ModelMetadata associated with the model.

key
String

The model prefix key.

model
Object

The model object.

alwaysValidateAtTopLevel
Boolean

If true, applies validation rules even if the top-level value is null.

Returns

true if the object is valid, otherwise false.

Applies to

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

Source:
ValidationVisitor.cs

Validates a object.

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

Parameters

metadata
ModelMetadata

The ModelMetadata associated with the model.

key
String

The model prefix key.

model
Object

The model object.

alwaysValidateAtTopLevel
Boolean

If true, applies validation rules even if the top-level value is null.

container
Object

The model container.

Returns

true if the object is valid, otherwise false.

Applies to