Share via


ObjectModelValidator.Validate Method

Definition

Overloads

Validate(ActionContext, ValidationStateDictionary, String, Object)

Validates the provided object.

Validate(ActionContext, ValidationStateDictionary, String, Object, ModelMetadata)

Validates the provided object model. If model is null and the metadata's IsRequired is true, will add one or more model state errors that Validate(ActionContext, ValidationStateDictionary, String, Object) would not.

Validate(ActionContext, ValidationStateDictionary, String, Object, ModelMetadata, Object)

Validates the provided object model. If model is null and the metadata's IsRequired is true, will add one or more model state errors that Validate(ActionContext, ValidationStateDictionary, String, Object) would not.

Validate(ActionContext, ValidationStateDictionary, String, Object)

Source:
ObjectModelValidator.cs
Source:
ObjectModelValidator.cs
Source:
ObjectModelValidator.cs

Validates the provided object.

public:
 virtual void Validate(Microsoft::AspNetCore::Mvc::ActionContext ^ actionContext, Microsoft::AspNetCore::Mvc::ModelBinding::Validation::ValidationStateDictionary ^ validationState, System::String ^ prefix, System::Object ^ model);
public virtual void Validate (Microsoft.AspNetCore.Mvc.ActionContext actionContext, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateDictionary validationState, string prefix, object model);
public virtual void Validate (Microsoft.AspNetCore.Mvc.ActionContext actionContext, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateDictionary? validationState, string? prefix, object? model);
abstract member Validate : Microsoft.AspNetCore.Mvc.ActionContext * Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateDictionary * string * obj -> unit
override this.Validate : Microsoft.AspNetCore.Mvc.ActionContext * Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateDictionary * string * obj -> unit
Public Overridable Sub Validate (actionContext As ActionContext, validationState As ValidationStateDictionary, prefix As String, model As Object)

Parameters

actionContext
ActionContext

The ActionContext associated with the current request.

validationState
ValidationStateDictionary

The ValidationStateDictionary. May be null.

prefix
String

The model prefix. Used to map the model object to entries in validationState.

model
Object

The model object.

Implements

Applies to

Validate(ActionContext, ValidationStateDictionary, String, Object, ModelMetadata)

Source:
ObjectModelValidator.cs
Source:
ObjectModelValidator.cs
Source:
ObjectModelValidator.cs

Validates the provided object model. If model is null and the metadata's IsRequired is true, will add one or more model state errors that Validate(ActionContext, ValidationStateDictionary, String, Object) would not.

public:
 virtual void Validate(Microsoft::AspNetCore::Mvc::ActionContext ^ actionContext, Microsoft::AspNetCore::Mvc::ModelBinding::Validation::ValidationStateDictionary ^ validationState, System::String ^ prefix, System::Object ^ model, Microsoft::AspNetCore::Mvc::ModelBinding::ModelMetadata ^ metadata);
public virtual void Validate (Microsoft.AspNetCore.Mvc.ActionContext actionContext, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateDictionary validationState, string prefix, object model, Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata metadata);
public virtual void Validate (Microsoft.AspNetCore.Mvc.ActionContext actionContext, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateDictionary? validationState, string? prefix, object? model, Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata metadata);
abstract member Validate : Microsoft.AspNetCore.Mvc.ActionContext * Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateDictionary * string * obj * Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata -> unit
override this.Validate : Microsoft.AspNetCore.Mvc.ActionContext * Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateDictionary * string * obj * Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata -> unit
Public Overridable Sub Validate (actionContext As ActionContext, validationState As ValidationStateDictionary, prefix As String, model As Object, metadata As ModelMetadata)

Parameters

actionContext
ActionContext

The ActionContext.

prefix
String

The model prefix key.

model
Object

The model object.

Applies to

Validate(ActionContext, ValidationStateDictionary, String, Object, ModelMetadata, Object)

Source:
ObjectModelValidator.cs

Validates the provided object model. If model is null and the metadata's IsRequired is true, will add one or more model state errors that Validate(ActionContext, ValidationStateDictionary, String, Object) would not.

public:
 virtual void Validate(Microsoft::AspNetCore::Mvc::ActionContext ^ actionContext, Microsoft::AspNetCore::Mvc::ModelBinding::Validation::ValidationStateDictionary ^ validationState, System::String ^ prefix, System::Object ^ model, Microsoft::AspNetCore::Mvc::ModelBinding::ModelMetadata ^ metadata, System::Object ^ container);
public virtual void Validate (Microsoft.AspNetCore.Mvc.ActionContext actionContext, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateDictionary validationState, string prefix, object model, Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata metadata, object container);
public virtual void Validate (Microsoft.AspNetCore.Mvc.ActionContext actionContext, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateDictionary? validationState, string? prefix, object? model, Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata metadata, object? container);
abstract member Validate : Microsoft.AspNetCore.Mvc.ActionContext * Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateDictionary * string * obj * Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata * obj -> unit
override this.Validate : Microsoft.AspNetCore.Mvc.ActionContext * Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ValidationStateDictionary * string * obj * Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata * obj -> unit
Public Overridable Sub Validate (actionContext As ActionContext, validationState As ValidationStateDictionary, prefix As String, model As Object, metadata As ModelMetadata, container As Object)

Parameters

actionContext
ActionContext

The ActionContext.

prefix
String

The model prefix key.

model
Object

The model object.

container
Object

The model container

Applies to