共用方式為


ValidatorCache.GetValidators(ModelMetadata, IModelValidatorProvider) 方法

定義

取得模型的驗證程式。

public:
 System::Collections::Generic::IReadOnlyList<Microsoft::AspNetCore::Mvc::ModelBinding::Validation::IModelValidator ^> ^ GetValidators(Microsoft::AspNetCore::Mvc::ModelBinding::ModelMetadata ^ metadata, Microsoft::AspNetCore::Mvc::ModelBinding::Validation::IModelValidatorProvider ^ validatorProvider);
public System.Collections.Generic.IReadOnlyList<Microsoft.AspNetCore.Mvc.ModelBinding.Validation.IModelValidator> GetValidators (Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata metadata, Microsoft.AspNetCore.Mvc.ModelBinding.Validation.IModelValidatorProvider validatorProvider);
member this.GetValidators : Microsoft.AspNetCore.Mvc.ModelBinding.ModelMetadata * Microsoft.AspNetCore.Mvc.ModelBinding.Validation.IModelValidatorProvider -> System.Collections.Generic.IReadOnlyList<Microsoft.AspNetCore.Mvc.ModelBinding.Validation.IModelValidator>
Public Function GetValidators (metadata As ModelMetadata, validatorProvider As IModelValidatorProvider) As IReadOnlyList(Of IModelValidator)

參數

metadata
ModelMetadata

模型中繼資料。

validatorProvider
IModelValidatorProvider

驗證程式提供者。

傳回

模型驗證程式的清單。

適用於