eQuantic.Validation.AspNetCore 2.2.0

dotnet add package eQuantic.Validation.AspNetCore --version 2.2.0
                    
NuGet\Install-Package eQuantic.Validation.AspNetCore -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.AspNetCore" 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.AspNetCore" Version="2.2.0" />
                    
Directory.Packages.props
<PackageReference Include="eQuantic.Validation.AspNetCore" />
                    
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.AspNetCore --version 2.2.0
                    
#r "nuget: eQuantic.Validation.AspNetCore, 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.AspNetCore@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.AspNetCore&version=2.2.0
                    
Install as a Cake Addin
#tool nuget:?package=eQuantic.Validation.AspNetCore&version=2.2.0
                    
Install as a Cake Tool

eQuantic.Validation.AspNetCore

ASP.NET Core integration for eQuantic.Validation, supporting Minimal APIs and MVC in .NET 8 and .NET 10.

dotnet add package eQuantic.Validation.AspNetCore

Quick Start

  1. Register validators in your Program.cs (AddValidator registers the validation dispatcher automatically; the names avoid colliding with .NET 10's built-in AddValidation):
builder.Services.AddValidator<CreateOrder, CreateOrderValidator>();
  1. For Minimal APIs, apply the endpoint filter. Rules run sequentially by default; parallel execution is opt-in and requires concurrency-safe rule dependencies:
app.MapPost("/orders", (CreateOrder command) => Results.Ok())
   .RequireValidation("create");

app.MapPost("/quotes", handler)
   .RequireValidation(ValidationExecutionMode.Parallel);
  1. For MVC Controllers, enable the global validation action filter:
builder.Services.AddControllers().AddValidationFilter();
  1. Enable OpenAPI 3.1 schema transformations and per-request localization (combine with UseRequestLocalization so Accept-Language drives the culture):
builder.Services.AddValidationLocalization<ValidationResources>();
builder.Services.AddOpenApi(options =>
{
    options.AddValidationTransformer();
});

Failed validation requests automatically return HTTP 400 with RFC 7807 / RFC 9457 ValidationProblemDetails. The errors dictionary maintains ASP.NET Core client compatibility, while extensions.issues provides structured code, path, and severity (emitted as JSON nodes, safe for source-generated serialization and Native AOT):

{
  "title": "One or more validation errors occurred.",
  "status": 400,
  "errors": { "Email": ["Email must be a valid email address."] },
  "issues": [
    { "path": "Email", "code": "customer.email.invalid", "message": "Email must be a valid email address.", "severity": "Error" }
  ]
}

Warnings on successful responses

Valid requests with Severity.Warning failures respond 200 with a Validation-Warnings header (path:code pairs). The full failures are available to the handler:

app.MapPut("/profile", (UpdateProfile request, HttpContext http) =>
{
    var warnings = ValidationWarnings.GetWarnings(http);
    return Results.Ok(new { saved = true, warnings });
}).RequireValidation();

Async rule deduplication

The filters create one validation context per request with async-rule deduplication enabled: the same MustAsync for the same instance and value (composed validators, duplicated collection elements, revalidation) performs its I/O once per request. No configuration needed.

Product Compatible and additional computed target framework versions.
.NET 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. 
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.2.0 107 8/16/2026
2.1.0 117 8/16/2026
2.0.0 106 8/16/2026
1.0.0 102 8/16/2026

Initial ASP.NET Core integration with scoped validators and RFC 7807-compatible responses.