Zeta 0.1.16
dotnet add package Zeta --version 0.1.16
NuGet\Install-Package Zeta -Version 0.1.16
<PackageReference Include="Zeta" Version="0.1.16" />
<PackageVersion Include="Zeta" Version="0.1.16" />
<PackageReference Include="Zeta" />
paket add Zeta --version 0.1.16
#r "nuget: Zeta, 0.1.16"
#:package Zeta@0.1.16
#addin nuget:?package=Zeta&version=0.1.16
#tool nuget:?package=Zeta&version=0.1.16
Zeta
Zeta is a schema-first validation framework for .NET with a fluent, async-first API.
using Zeta;
var schema = Z.Schema<User>()
.Property(x => x.Email, s => s.Email())
.Property(x => x.Age, s => s.Min(18));
var result = await schema.ValidateAsync(new User("alice@example.com", 21));
if (!result.IsSuccess)
{
foreach (var error in result.Errors)
Console.WriteLine($"{error.PathString}: {error.Message}");
}
public sealed record User(string Email, int Age);
Quick Start
dotnet add package Zeta
# Optional: ASP.NET Core integration (Minimal APIs / Controllers)
dotnet add package Zeta.AspNetCore
# Optional: FastEndpoints integration
dotnet add package Zeta.FastEndpoints
Core Examples
1. Minimal API Validation
using Zeta;
using Zeta.AspNetCore;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddZeta();
var app = builder.Build();
var createUserSchema = Z.Schema<CreateUserRequest>()
.Property(x => x.Email, s => s.Email())
.Property(x => x.Name, s => s.MinLength(2));
app.MapPost("/users", (CreateUserRequest request) => Results.Ok(request))
.WithValidation(createUserSchema);
app.Run();
public sealed record CreateUserRequest(string Email, string Name);
2. Context-Aware Rules with .Using(...)
var registerSchema = Z.Schema<RegisterRequest>()
.Using<RegisterContext>(async (input, sp, ct) =>
{
var repo = sp.GetRequiredService<IUserRepository>();
var exists = await repo.EmailExistsAsync(input.Email, ct);
return new RegisterContext(exists);
})
.Property(x => x.Email, s => s.Email())
.Refine((x, ctx) => !ctx.EmailExists, "Email already exists", "email_exists");
public sealed record RegisterRequest(string Email);
public sealed record RegisterContext(bool EmailExists);
3. Collection Validation with .Each(...)
var orderSchema = Z.Schema<CreateOrderRequest>()
.Property(x => x.Items, items => items
.Each(i => i
.Property(v => v.ProductId, s => s.NotEmpty())
.Property(v => v.Quantity, s => s.Min(1)))
.MinLength(1));
public sealed record CreateOrderRequest(List<OrderItem> Items);
public sealed record OrderItem(string ProductId, int Quantity);
This repository contains:
- Core package source:
src/Zeta - ASP.NET Core integration package source:
src/Zeta.AspNetCore - FastEndpoints integration package source:
src/Zeta.FastEndpoints - Source generators:
src/Zeta.SourceGenerators - Tests:
tests - Samples:
samples - Benchmarks:
benchmarks
Package Documentation
- Core validation package (
Zeta):src/Zeta/README.md - ASP.NET Core integration package (
Zeta.AspNetCore):src/Zeta.AspNetCore/README.md - FastEndpoints integration package (
Zeta.FastEndpoints):src/Zeta.FastEndpoints/README.md - Guides:
docs
Which package should I use?
Zeta: Use in any .NET app (Console, Worker, Blazor, MAUI, libraries).Zeta.AspNetCore: Add only when you need ASP.NET Core integration (Minimal APIs, Controllers, validation filters).Zeta.FastEndpoints: Add when you use FastEndpoints as your web framework.
Build and Test
dotnet build
dotnet test
Samples
# ASP.NET Core sample
dotnet run --project samples/Zeta.Sample.Api
# Blazor sample
dotnet run --project samples/Zeta.Sample.Blazor
# FastEndpoints sample
dotnet run --project samples/Zeta.Sample.FastEndpoints.Api
Benchmarks
Comparing Zeta against FluentValidation and DataAnnotations on .NET 10 (Apple M2 Pro).
| Method | Mean | Allocated |
|---|---|---|
| FluentValidation | 131.2 ns | 600 B |
| FluentValidation (Async) | 230.1 ns | 672 B |
| Zeta | 353.2 ns | 216 B |
| Zeta (Invalid) | 442.2 ns | 1,048 B |
| DataAnnotations | 627.9 ns | 1,848 B |
| DataAnnotations (Invalid) | 990.5 ns | 2,672 B |
| FluentValidation (Invalid) | 1,923.9 ns | 7,728 B |
| FluentValidation (Invalid Async) | 2,095.5 ns | 7,800 B |
Key findings:
- Allocates 64% less memory than FluentValidation on valid input (216 B vs 600 B)
- Allocates 7.4x less memory than FluentValidation on invalid input (1,048 B vs 7,728 B)
- 4.4x faster than FluentValidation when validation fails (442 ns vs 1,924 ns)
- 2.2x faster than DataAnnotations when validation fails (442 ns vs 991 ns)
Run benchmarks:
dotnet run --project benchmarks/Zeta.Benchmarks -c Release
Changelog
See CHANGELOG.md.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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 is compatible. 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 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
- No dependencies.
-
net6.0
- No dependencies.
-
net7.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Zeta:
| Package | Downloads |
|---|---|
|
Zeta.AspNetCore
ASP.NET Core integration for Zeta validation framework. Includes Minimal API filters, IZetaValidator service, and Result extensions. |
|
|
Zeta.FastEndpoints
FastEndpoints integration for Zeta validation framework. Provides ZetaPreProcessor and ZetaEndpoint base classes for pre-processor pipeline validation — handles both contextless and context-aware schemas. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.16 | 151 | 3/1/2026 |
| 0.1.15 | 89 | 2/22/2026 |
| 0.1.14 | 90 | 2/19/2026 |
| 0.1.13 | 95 | 2/18/2026 |
| 0.1.12 | 99 | 2/17/2026 |
| 0.1.11 | 97 | 2/12/2026 |
| 0.1.10 | 82 | 2/11/2026 |
| 0.1.9 | 83 | 2/3/2026 |
| 0.1.8 | 85 | 1/29/2026 |
| 0.1.7 | 85 | 1/28/2026 |
| 0.1.6 | 94 | 1/27/2026 |
| 0.1.5 | 84 | 1/26/2026 |
| 0.1.4 | 91 | 1/24/2026 |
| 0.1.3 | 96 | 1/23/2026 |
| 0.1.2 | 92 | 1/23/2026 |