Redigera

Dela via


AssociatedValidatorProvider.GetValidators Method

Definition

Gets the validators for the model.

Overloads

GetValidators(ModelMetadata, ModelBindingExecutionContext)

Gets the validators for the model using the specified metadata and execution context.

GetValidators(ModelMetadata, ModelBindingExecutionContext, IEnumerable<Attribute>)

When implemented in a derived type, gets the validators for the model, using the specified metadata, execution context, and attributes.

GetValidators(ModelMetadata, ModelBindingExecutionContext)

Gets the validators for the model using the specified metadata and execution context.

public:
 override System::Collections::Generic::IEnumerable<System::Web::ModelBinding::ModelValidator ^> ^ GetValidators(System::Web::ModelBinding::ModelMetadata ^ metadata, System::Web::ModelBinding::ModelBindingExecutionContext ^ context);
public override sealed System.Collections.Generic.IEnumerable<System.Web.ModelBinding.ModelValidator> GetValidators (System.Web.ModelBinding.ModelMetadata metadata, System.Web.ModelBinding.ModelBindingExecutionContext context);
override this.GetValidators : System.Web.ModelBinding.ModelMetadata * System.Web.ModelBinding.ModelBindingExecutionContext -> seq<System.Web.ModelBinding.ModelValidator>
Public Overrides NotOverridable Function GetValidators (metadata As ModelMetadata, context As ModelBindingExecutionContext) As IEnumerable(Of ModelValidator)

Parameters

metadata
ModelMetadata

The metadata.

context
ModelBindingExecutionContext

The execution context.

Returns

The validators.

Exceptions

The metadata or context parameter is null.

The property name in the metadata does not refer to one of the properties of the container type.

Applies to

GetValidators(ModelMetadata, ModelBindingExecutionContext, IEnumerable<Attribute>)

When implemented in a derived type, gets the validators for the model, using the specified metadata, execution context, and attributes.

protected:
 abstract System::Collections::Generic::IEnumerable<System::Web::ModelBinding::ModelValidator ^> ^ GetValidators(System::Web::ModelBinding::ModelMetadata ^ metadata, System::Web::ModelBinding::ModelBindingExecutionContext ^ context, System::Collections::Generic::IEnumerable<Attribute ^> ^ attributes);
protected abstract System.Collections.Generic.IEnumerable<System.Web.ModelBinding.ModelValidator> GetValidators (System.Web.ModelBinding.ModelMetadata metadata, System.Web.ModelBinding.ModelBindingExecutionContext context, System.Collections.Generic.IEnumerable<Attribute> attributes);
override this.GetValidators : System.Web.ModelBinding.ModelMetadata * System.Web.ModelBinding.ModelBindingExecutionContext * seq<Attribute> -> seq<System.Web.ModelBinding.ModelValidator>
Protected MustOverride Function GetValidators (metadata As ModelMetadata, context As ModelBindingExecutionContext, attributes As IEnumerable(Of Attribute)) As IEnumerable(Of ModelValidator)

Parameters

metadata
ModelMetadata

The metadata.

context
ModelBindingExecutionContext

The execution context.

attributes
IEnumerable<Attribute>

The attributes.

Returns

The validators.

Applies to