Info
Version: | 4.0.0 |
Author(s): | ryanelian |
Last Update: | Friday, November 13, 2020 |
.NET Fiddle: | Create the first Fiddle |
Project Url: | https://github.com/ryanelian/FluentValidation.Blazor |
NuGet Url: | https://www.nuget.org/packages/Accelist.FluentValidation.Blazor |
Install
Install-Package Accelist.FluentValidation.Blazor
dotnet add package Accelist.FluentValidation.Blazor
paket add Accelist.FluentValidation.Blazor
Accelist.FluentValidation.Blazor Download (Unzip the "nupkg" after downloading)
Dependencies
- FluentValidation(>= 9.3.0)
- Microsoft.AspNetCore.Components(>= 5.0.0)
- Microsoft.AspNetCore.Components.Web(>= 5.0.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.