Skip to content

Run validation in an async context to allow async rules in FluentValidation v11 #14

@killergege

Description

@killergege

Is your feature request related to a problem? Please describe.
Until now FluentValidation, async rules were silently run as synchronous, so they could be used.
Since v11, it now throws an exception when an async rule is executed synchronously, a lot of our validators are now throwing exceptions when validating a command.

Describe the solution you'd like
Very very quickly looking at the code, it looks like the Validate() is already running in an async context.
So it should be possible to call ValidateAsync instead of Validate, allowing to use async rules without too much impact.
Could it be possible to change the code to do that ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions