Info
Version: | 3.0.0 |
Author(s): | ryanelian |
Last Update: | Friday, August 21, 2020 |
.NET Fiddle: | Create the first Fiddle |
Project Url: | https://github.com/ryanelian/FluentValidation.Blazor |
NuGet Url: | https://www.nuget.org/packages/OpenIdentity.FluentValidation.Blazor |
Install
Install-Package OpenIdentity.FluentValidation.Blazor
dotnet add package OpenIdentity.FluentValidation.Blazor
paket add OpenIdentity.FluentValidation.Blazor
OpenIdentity.FluentValidation.Blazor Download (Unzip the "nupkg" after downloading)
Dependencies
- FluentValidation(>= 9.0.1)
- Microsoft.AspNetCore.Components(>= 3.1.0)
- Microsoft.AspNetCore.Components.Web(>= 3.1.0)
https://github.com/ryanelian/FluentValidation.Blazor/blob/master/README.MD
This library is a direct replacement to the default Blazor <DataAnnotationValidator> with zero configuration required ⚡️ in the application code base.
The <FluentValidation.FluentValidator> component automatically detects the Model data type used by the parent <EditForm> then attempts to acquire the corresponding FluentValidation.IValidator<T> for that model data type.
For this reason, in addition to coding the usual FluentValidation.AbstractValidator<T> Fluent Validation implementation, you are required to register the FluentValidation.IValidator<T> implementation in the Startup.cs Service Provider (Dependency Injection).
This effectively allows you, dear programmer, to inject required services to your validation implementations for writing amazing custom validation methods! 🔥
Validator parameter may also be passed directly to the component to inline the AbstractValidator implementation instead of relying on .NET Core DI.