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 | Return | Parameters |
|---|---|---|
Validate | void | IValidation validation, object newValidationValue |
Runs the matching validator synchronously and updates the validation status and messages.
| ||
ValidateAsync | Task | IValidation validation, object newValidationValue, CancellationToken cancellationToken = default |
Runs the matching validator asynchronously and updates the validation status and messages.
| ||
AddBlazoriseFluentValidation
Extension method
| Method | Return | Parameters |
|---|---|---|
AddBlazoriseFluentValidation | IServiceCollection | IServiceCollection services |
Registers FluentValidationHandler as a scoped service and returns the service collection.
| ||