AssociatedValidatorProvider.GetValidators Metod
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Hämtar validatorerna för modellen.
Överlagringar
| Name | Description |
|---|---|
| GetValidators(ModelMetadata, ModelBindingExecutionContext) |
Hämtar validatorerna för modellen med hjälp av angivna metadata och körningskontext. |
| GetValidators(ModelMetadata, ModelBindingExecutionContext, IEnumerable<Attribute>) |
När den implementeras i en härledd typ hämtar du validatorerna för modellen med hjälp av angivna metadata, körningskontext och attribut. |
GetValidators(ModelMetadata, ModelBindingExecutionContext)
Hämtar validatorerna för modellen med hjälp av angivna metadata och körningskontext.
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)
Parametrar
- metadata
- ModelMetadata
Metadata.
- context
- ModelBindingExecutionContext
Körningskontexten.
Returer
Validatorerna.
Undantag
Parametern metadata eller context är null.
Egenskapsnamnet i metadata refererar inte till någon av egenskaperna för containertypen.
Gäller för
GetValidators(ModelMetadata, ModelBindingExecutionContext, IEnumerable<Attribute>)
När den implementeras i en härledd typ hämtar du validatorerna för modellen med hjälp av angivna metadata, körningskontext och attribut.
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)
Parametrar
- metadata
- ModelMetadata
Metadata.
- context
- ModelBindingExecutionContext
Körningskontexten.
- attributes
- IEnumerable<Attribute>
Attributen.
Returer
Validatorerna.