Skip to content

Async Model Validation #7573

@bradlis7

Description

@bradlis7

Is your feature request related to a problem? Please describe.

Model validation is synchronous, but if there's a database call or other awaitable call, it would be nice to have an async option.

See aspnet/Mvc#786.

Describe the solution you'd like

Add virtual methods for ValidationAttribute:

Task<bool> IsValidAsync(object value);
Task<ValidationResult> IsValidAsync(object value, ValidationContext validationContext);

Describe alternatives you've considered

Currently working around by using synchronous DB calls.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-mvcIncludes: MVC, Actions and Controllers, Localization, CORS, most templates

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions