eQuantic.Validation 2.2.0

dotnet add package eQuantic.Validation --version 2.2.0
                    
NuGet\Install-Package eQuantic.Validation -Version 2.2.0
                    
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="eQuantic.Validation" Version="2.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="eQuantic.Validation" Version="2.2.0" />
                    
Directory.Packages.props
<PackageReference Include="eQuantic.Validation" />
                    
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 eQuantic.Validation --version 2.2.0
                    
#r "nuget: eQuantic.Validation, 2.2.0"
                    
#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 eQuantic.Validation@2.2.0
                    
#: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=eQuantic.Validation&version=2.2.0
                    
Install as a Cake Addin
#tool nuget:?package=eQuantic.Validation&version=2.2.0
                    
Install as a Cake Tool

eQuantic.Validation

Framework-independent fluent validation engine for the eQuantic ecosystem.

dotnet add package eQuantic.Validation
public sealed class CreateOrderValidator : Validator<CreateOrder>
{
    public CreateOrderValidator()
    {
        RuleFor(x => x.CustomerEmail).NotWhiteSpace().Email();
        RuleFor(x => x.Total).GreaterThan(0m);
        RuleFor(x => x.Installments).GreaterThanOrEqualTo(1).LessThanOrEqualTo(12);
        RuleFor(x => x.Currency).NotNull().OneOf("BRL", "EUR", "USD");
        RuleForEach(x => x.Items).SetValidator(new OrderItemValidator());
    }
}

var result = await new CreateOrderValidator().ValidateAsync(order, cancellationToken: cancellationToken);

Use fluent rules for domain logic, cross-field pattern matching, Value Objects, and service-dependent rules. String rules (Email, MinimumLength, Matches, …) only bind to string properties, failing at compile time elsewhere. For DTOs with System.ComponentModel.DataAnnotations, instantiate or register AttributeValidator<T> to produce the same structured ValidationResult.

No subclass? Use InlineValidator

var validator = new InlineValidator<Customer>(v =>
{
    v.RuleFor(x => x.Email).NotWhiteSpace().Email();
    v.RuleFor(x => x.Age).InclusiveBetween(18, 120);
});

Warnings and severities

Rules can warn without blocking; IsValid ignores warnings and they stay available on the result:

RuleFor(x => x.Nickname)
    .Must(n => n != "legacy", "profile.nickname.legacy")
    .WithSeverity(ValidationSeverity.Warning);

var result = validator.Validate(profile);
// result.IsValid == true; result.Warnings => [ { Path: "Nickname", Code: "profile.nickname.legacy" } ]

Rules as data

Every validator implements IDescribableValidator: Describe() returns the rule manifest (paths, kinds, codes, parameters), and ZodSchemaExporter turns it into a client-side schema:

var manifest = new CreateOrderValidator().Describe();
string ts = eQuantic.Validation.Export.ZodSchemaExporter.Export(new CreateOrderValidator());
// export const createOrderSchema = z.object({ customerEmail: z.string().min(1).email(), ... });

Async rules that don't repeat I/O

With new ValidationContext(deduplicateAsyncRules: true) (the ASP.NET Core integrations enable this per request automatically), the same async rule for the same instance and value runs once — composed validators, duplicated collection elements and revalidation reuse the first result.

Dependency-injection dispatching ships in this package (AddValidationDispatcher, AddValidator<TModel, TValidator> and IValidationDispatcher), so workers, gRPC services and console apps can validate without referencing ASP.NET Core — the only dependency is Microsoft.Extensions.DependencyInjection.Abstractions. OpenTelemetry instrumentation (eQuantic.Validation meter and activity source) is built in.

This package implements eQuantic.Validation.Abstractions. For web endpoints and controllers, use eQuantic.Validation.AspNetCore; for compile-time validators, accessor pre-compilation and usage diagnostics, add eQuantic.Validation.Generator.

Complete documentation: https://github.com/eQuantic/core-validation

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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 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 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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on eQuantic.Validation:

Package Downloads
eQuantic.Validation.AspNetCore

Opt-in eQuantic.Validation integration for ASP.NET Core Minimal APIs and MVC controllers.

eQuantic.Validation.Testing

Test helpers for eQuantic.Validation: TestValidate with chainable, framework-agnostic assertions over structured failures (path, code, severity and arguments).

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.2.0 161 8/16/2026
2.1.0 165 8/16/2026
2.0.0 111 8/16/2026
1.0.0 90 8/16/2026

Breaking: DI dispatching moved into the core package as AddValidationDispatcher/AddValidator, string rules are now compile-time typed.