Purview.EventSourcing.Validation.ZodSharp
2.0.0-prerelease.32
dotnet add package Purview.EventSourcing.Validation.ZodSharp --version 2.0.0-prerelease.32
NuGet\Install-Package Purview.EventSourcing.Validation.ZodSharp -Version 2.0.0-prerelease.32
<PackageReference Include="Purview.EventSourcing.Validation.ZodSharp" Version="2.0.0-prerelease.32" />
<PackageVersion Include="Purview.EventSourcing.Validation.ZodSharp" Version="2.0.0-prerelease.32" />
<PackageReference Include="Purview.EventSourcing.Validation.ZodSharp" />
paket add Purview.EventSourcing.Validation.ZodSharp --version 2.0.0-prerelease.32
#r "nuget: Purview.EventSourcing.Validation.ZodSharp, 2.0.0-prerelease.32"
#:package Purview.EventSourcing.Validation.ZodSharp@2.0.0-prerelease.32
#addin nuget:?package=Purview.EventSourcing.Validation.ZodSharp&version=2.0.0-prerelease.32&prerelease
#tool nuget:?package=Purview.EventSourcing.Validation.ZodSharp&version=2.0.0-prerelease.32&prerelease
Purview.EventSourcing.ZodSharp
Purview.EventSourcing.ZodSharp adapts ZodSharp schema validators to the Purview EventSourcing aggregate validation contract (IAggregateValidator<TAggregate>).
Install
dotnet add package Purview.EventSourcing.ZodSharp
Register the adapter
With an explicit schema validator implementation
Registers both the ZodSharp schema validator and the aggregate-validator adapter:
builder.Services.AddZodSharpAdapter<OrderAggregate, OrderSchema>();
When schema validators are already registered
Use this overload when the schema validator is already registered in the container. The adapter resolves IZodSchemaValidator<TAggregate> from the container:
builder.Services.AddZodSharpAdapter<OrderAggregate>();
Both overloads accept an optional ServiceLifetime (defaults to Singleton).
Important: reference ZodSharp directly
The adapter's public surface exposes ZodSharp.Core.IZodSchemaValidator<TAggregate>, so the consuming project must include a direct PackageReference to ZodSharp. The package enforces this with a build-time guardrail: the build fails with a clear error if you reference this package without also referencing ZodSharp.
<ItemGroup>
<PackageReference Include="Purview.EventSourcing.ZodSharp" Version="..." />
<PackageReference Include="ZodSharp" Version="..." />
</ItemGroup>
See docs/wiki/Dependency-Guardrails.md for the full rationale.
Typical usage
// The store invokes the registered IAggregateValidator<TAggregate> before saving.
await store.SaveAsync(order, cancellationToken);
What it provides
ZodSharpAggregateValidator<TAggregate>- converts ZodSharp validation results into the framework'sPurview.EventSourcing.Validation.ValidationResultIAggregateValidator<TAggregate>registration consumed by the event store during save- A
buildTransitivetarget that validates the directZodSharpreference
Notes
- This package is optional. The core package never acquires a mandatory ZodSharp 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 - FluentValidation integration:
Purview.EventSourcing.FluentValidation
| 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
- 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)
- Purview.ZodSharp (>= 2.0.0-prerelease.6)
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 | 0 | 9/15/2026 |
| 2.0.0-prerelease.31 | 39 | 9/12/2026 |
| 2.0.0-prerelease.30 | 47 | 9/8/2026 |