Compartilhar via


DataAnnotationsModelValidator.Validate Method

Returns a list of validation error messages for the model.

Namespace:  System.Web.Mvc
Assembly:  System.Web.Mvc (in System.Web.Mvc.dll)

Syntax

'Declaration
Public Overrides Function Validate ( _
    container As Object _
) As IEnumerable(Of ModelValidationResult)
public override IEnumerable<ModelValidationResult> Validate(
    Object container
)
public:
virtual IEnumerable<ModelValidationResult^>^ Validate(
    Object^ container
) override

Parameters

Return Value

Type: System.Collections.Generic.IEnumerable<ModelValidationResult>
A list of validation error messages for the model, or an empty list if no errors have occurred.

See Also

Reference

DataAnnotationsModelValidator Class

System.Web.Mvc Namespace