Purview.EventSourcing.Validation.ZodSharp 2.0.0-prerelease.32

This is a prerelease version of Purview.EventSourcing.Validation.ZodSharp.
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
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Purview.EventSourcing.Validation.ZodSharp" Version="2.0.0-prerelease.32" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Purview.EventSourcing.Validation.ZodSharp" Version="2.0.0-prerelease.32" />
                    
Directory.Packages.props
<PackageReference Include="Purview.EventSourcing.Validation.ZodSharp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Purview.EventSourcing.Validation.ZodSharp --version 2.0.0-prerelease.32
                    
#r "nuget: Purview.EventSourcing.Validation.ZodSharp, 2.0.0-prerelease.32"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Purview.EventSourcing.Validation.ZodSharp@2.0.0-prerelease.32
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Purview.EventSourcing.Validation.ZodSharp&version=2.0.0-prerelease.32&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Purview.EventSourcing.Validation.ZodSharp&version=2.0.0-prerelease.32&prerelease
                    
Install as a Cake Tool

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's Purview.EventSourcing.Validation.ValidationResult
  • IAggregateValidator<TAggregate> registration consumed by the event store during save
  • A buildTransitive target that validates the direct ZodSharp reference

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.
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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