Purview.EventSourcing.Validation.FluentValidation
2.0.0-prerelease.32
dotnet add package Purview.EventSourcing.Validation.FluentValidation --version 2.0.0-prerelease.32
NuGet\Install-Package Purview.EventSourcing.Validation.FluentValidation -Version 2.0.0-prerelease.32
<PackageReference Include="Purview.EventSourcing.Validation.FluentValidation" Version="2.0.0-prerelease.32" />
<PackageVersion Include="Purview.EventSourcing.Validation.FluentValidation" Version="2.0.0-prerelease.32" />
<PackageReference Include="Purview.EventSourcing.Validation.FluentValidation" />
paket add Purview.EventSourcing.Validation.FluentValidation --version 2.0.0-prerelease.32
#r "nuget: Purview.EventSourcing.Validation.FluentValidation, 2.0.0-prerelease.32"
#:package Purview.EventSourcing.Validation.FluentValidation@2.0.0-prerelease.32
#addin nuget:?package=Purview.EventSourcing.Validation.FluentValidation&version=2.0.0-prerelease.32&prerelease
#tool nuget:?package=Purview.EventSourcing.Validation.FluentValidation&version=2.0.0-prerelease.32&prerelease
Purview.EventSourcing.FluentValidation
Purview.EventSourcing.FluentValidation adapts FluentValidation validators to the Purview EventSourcing aggregate validation contract (IAggregateValidator<TAggregate>).
Install
dotnet add package Purview.EventSourcing.FluentValidation
Register the adapter
With an explicit validator implementation
Registers both the FluentValidation validator and the aggregate-validator adapter:
builder.Services.AddFluentValidationAdapter<OrderAggregate, OrderValidator>();
When validators are already registered
Use this overload when the validator is already registered in the container (for example, via AddValidatorsFromAssembly). The adapter resolves IValidator<TAggregate> from the container:
builder.Services.AddFluentValidationAdapter<OrderAggregate>();
Both overloads accept an optional ServiceLifetime (defaults to Singleton).
Typical usage
// The store invokes the registered IAggregateValidator<TAggregate> before saving.
await store.SaveAsync(order, cancellationToken);
What it provides
FluentValidationAggregateValidator<TAggregate>- convertsValidationResultfailures into the framework'sPurview.EventSourcing.Validation.ValidationResultIAggregateValidator<TAggregate>registration consumed by the event store during save
Notes
- This package is optional. The core package never acquires a mandatory FluentValidation dependency.
- Validation is invoked by the event store when an aggregate is saved; failing validations produce a non-saved save result.
Related packages
- Core package:
Purview.EventSourcing - ZodSharp integration:
Purview.EventSourcing.Validation.ZodSharp
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- FluentValidation (>= 12.1.1)
- Microsoft.Extensions.Caching.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.12)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Options (>= 10.0.12)
- Microsoft.Extensions.Telemetry.Abstractions (>= 10.10.0)
- Purview.EventSourcing (>= 2.0.0-prerelease.32)
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 |
|---|---|---|
| 2.0.0-prerelease.32 | 35 | 9/15/2026 |
| 2.0.0-prerelease.31 | 50 | 9/12/2026 |
| 2.0.0-prerelease.30 | 58 | 9/8/2026 |