Blazorise FluentValidation API
Review the handler and registration method used to connect FluentValidation validators to Blazorise validation components.
For setup instructions and examples, see the FluentValidation documentation.
API
FluentValidationHandler
Resolves the registered FluentValidation validator for a model and reports its result through the Blazorise validation lifecycle.
Methods
| Method | Description | Return | Parameters |
|---|---|---|---|
Validate |
Runs the matching validator synchronously and updates the validation status and messages. | void | IValidation validation, object newValidationValue |
ValidateAsync |
Runs the matching validator asynchronously and updates the validation status and messages. | Task | IValidation validation, object newValidationValue, CancellationToken cancellationToken = default |
AddBlazoriseFluentValidation
Extension method
| Method | Description | Return | Parameters |
|---|---|---|---|
AddBlazoriseFluentValidation |
Registers FluentValidationHandler as a scoped service and returns the service collection.
| IServiceCollection | IServiceCollection services |