Tenekon.FluentValidation.Extensions.AspNetCore.Components
1.0.42-alpha-gf27ed5ad86
Prefix Reserved
dotnet add package Tenekon.FluentValidation.Extensions.AspNetCore.Components --version 1.0.42-alpha-gf27ed5ad86
NuGet\Install-Package Tenekon.FluentValidation.Extensions.AspNetCore.Components -Version 1.0.42-alpha-gf27ed5ad86
<PackageReference Include="Tenekon.FluentValidation.Extensions.AspNetCore.Components" Version="1.0.42-alpha-gf27ed5ad86" />
<PackageVersion Include="Tenekon.FluentValidation.Extensions.AspNetCore.Components" Version="1.0.42-alpha-gf27ed5ad86" />
<PackageReference Include="Tenekon.FluentValidation.Extensions.AspNetCore.Components" />
paket add Tenekon.FluentValidation.Extensions.AspNetCore.Components --version 1.0.42-alpha-gf27ed5ad86
#r "nuget: Tenekon.FluentValidation.Extensions.AspNetCore.Components, 1.0.42-alpha-gf27ed5ad86"
#:package Tenekon.FluentValidation.Extensions.AspNetCore.Components@1.0.42-alpha-gf27ed5ad86
#addin nuget:?package=Tenekon.FluentValidation.Extensions.AspNetCore.Components&version=1.0.42-alpha-gf27ed5ad86&prerelease
#tool nuget:?package=Tenekon.FluentValidation.Extensions.AspNetCore.Components&version=1.0.42-alpha-gf27ed5ad86&prerelease
Tenekon.FluentValidation.Extensions

🚧 This is a new project. You are very welcome to participate in this project, help shape the public API and share ideas. The project is currently in alpha state, so the public API may change significantly.
Table of Contents
Packages
Package Description | |
---|---|
Tenekon.FluentValidation.Extensions.AspNetCore.Components <br/> |
Blazor integration for FluentValidation |
Tenekon.FluentValidation.Extensions.AspNetCore.Components
An extension to integrate FluentValidation with ASP.NET Core Components (Blazor Components). This library enhances component-level validation in Blazor applications using FluentValidation.
📖 For usage examples, see the Validator Components Cookbook covering common and advanced scenarios.
Features
- 🌞 Seamless integration with Blazor forms<sup>1</sup>
- :jigsaw: Validate not only top-level anymore – just wrap each edit model part by a validator component<sup>2,4</sup>
- :jigsaw: Nestable edit model validators – nested child validator components<sup>2</sup> still hook into the validation of the main form<sup>3</sup>.
- 🔌 Component-region validation — plug validators<sup>2</sup> into forms or any part of a form or any nested region or subregion.<sup>3</sup>
<small><sup>1</sup>: Any form that provides a cascaded EditContext
, even a plain CascadedValue Value="new EditContext(..)">..</CascadedValue>
is sufficient.</small><br/>
<small><sup>2</sup>: Refers to the usage of validator components of this library.</small><br/>
<small><sup>3</sup>: Nested child edit model validators automatically receive the nearest EditContext
, captured by the first validator component<sup>2</sup> higher in the hierarchy (usually from a form<sup>1</sup>).</small><br/>
<small><sup>4</sup>: EditModelValidatorSubpath
and EditModelScope
have the capability to create an isolated EditContxt
wired to the nearest EditContext
<sup>3</sup>.
Quickstart
dotnet add package Tenekon.FluentValidation.Extensions.AspNetCore.Components
2. Define your validator using FluentValidation
:
public class ModelValidator : AbstractValidator<MyModel>
{
public ModelValidator()
{
RuleFor(x => x.Name).NotEmpty();
}
}
Requires
FluentValidation
package to be installed.
3. Register the validator in your DI container:
builder.Services.AddValidatorsFromAssemblyContaining<ModelValidator>();
Requires
FluentValidation.DependencyInjectionExtensions
package to be installed.
4. Use the validator component(s) in your Blazor form:
@code {
private Model _model = new Model {
Name = default(string)
Children = (List<SubModel>)[
new SubModel {
Name = default(string)
}
]
};
}
<EditForm Model="_model" OnValidSubmit="HandleValidSubmit">
<EditModelValidatorRootpath ValidatorType="typeof(ModelValidator)" />
<InputText @bind-Value="_model.Name" />
<ValidationMessage For="() => _model.Name" />
@foreach(var child in _model.Children) {
<EditModelValidatorSubpath Model="child" ValidatorType="typeof(SubModelValidator)">
<InputText @bind-Value="child.Name"/>
<ValidationMessage For="() => child.Name"/>
<button type="submit">Prematurely Submit</button>
</EditModelValidatorSubpath>
}
<button type="submit">Submit</button>
</EditForm>
Documentation & Resources
- 📖 Cookbook: Validator Components Cookbook — Examples & use cases for all common and advanced scenarios.
- :bricks: Architecture Validator Components Architecture — Architectural approach of the components, and their integration with Blazor's EditContext.
- 🔬 Flow Logic: Validator Components Flow Logic — Visual guide to
how edit model validators interact with each other and Blazor's
EditContext
.
Target Framework
.NET 8.0
Dependencies
FluentValidation
12.xMicrosoft.AspNetCore.Components.Forms
8.xFastExpressionCompiler
5.x
Development
git clone https://github.com/tenekon/Tenekon.FluentValidation.Extensions.git
cd Tenekon.FluentValidation.Extensions
dotnet build
License
MIT License - see LICENSE for details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- FastExpressionCompiler (>= 5.3.0)
- FluentValidation (>= 12.0.0)
- Microsoft.AspNetCore.Components.Forms (>= 8.0.18)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.0.42-alpha-gf27ed5ad86 | 92 | 7/28/2025 |
1.0.40-alpha-gac9cdc2716 | 98 | 7/27/2025 |
1.0.37-alpha-gce928b8c06 | 240 | 7/26/2025 |
1.0.31-alpha-g8de9e4a020 | 494 | 7/22/2025 |
1.0.17-alpha-g4ac8c36ae7 | 281 | 7/21/2025 |
1.0.14-alpha-gd8abd9ba75 | 26 | 7/19/2025 |
1.0.6-alpha-g5c83fc27bb | 73 | 6/27/2025 |
1.0.1-alpha-ge071d15233 | 113 | 6/26/2025 |