共用方式為


DataAnnotationsModelValidator.Validate(Object) 方法

定義

傳回模型的驗證錯誤訊息清單。

public:
 override System::Collections::Generic::IEnumerable<System::Web::ModelBinding::ModelValidationResult ^> ^ Validate(System::Object ^ container);
public override System.Collections.Generic.IEnumerable<System.Web.ModelBinding.ModelValidationResult> Validate (object container);
override this.Validate : obj -> seq<System.Web.ModelBinding.ModelValidationResult>
Public Overrides Function Validate (container As Object) As IEnumerable(Of ModelValidationResult)
Public Iterator Overrides Function Validate (container As Object) As IEnumerable(Of ModelValidationResult)

參數

container
Object

模型的容器。

傳回

IEnumerable<ModelValidationResult>

驗證錯誤訊息的清單,如果未發生錯誤則為空白清單。

適用於