Trellis.Mediator.FluentValidation
3.0.0-alpha.539
See the version list below for details.
dotnet add package Trellis.Mediator.FluentValidation --version 3.0.0-alpha.539
NuGet\Install-Package Trellis.Mediator.FluentValidation -Version 3.0.0-alpha.539
<PackageReference Include="Trellis.Mediator.FluentValidation" Version="3.0.0-alpha.539" />
<PackageVersion Include="Trellis.Mediator.FluentValidation" Version="3.0.0-alpha.539" />
<PackageReference Include="Trellis.Mediator.FluentValidation" />
paket add Trellis.Mediator.FluentValidation --version 3.0.0-alpha.539
#r "nuget: Trellis.Mediator.FluentValidation, 3.0.0-alpha.539"
#:package Trellis.Mediator.FluentValidation@3.0.0-alpha.539
#addin nuget:?package=Trellis.Mediator.FluentValidation&version=3.0.0-alpha.539&prerelease
#tool nuget:?package=Trellis.Mediator.FluentValidation&version=3.0.0-alpha.539&prerelease
Trellis.Mediator.FluentValidation
Mediator pipeline adapter that plugs FluentValidation validators into the Trellis.Mediator validation stage.
Why this package exists
Trellis.FluentValidation is a Domain-layer concern — it converts FluentValidation ValidationResult to Result<T> for use in any application layer. Trellis.Mediator is an application / composition-layer concern — it provides the mediator pipeline behaviors (validation, authorization, logging, etc.).
This package bridges the two without forcing Domain projects to take a transitive Mediator dependency. Reference it from your Application (or composition root) project; keep Trellis.FluentValidation in your Domain project.
Installation
dotnet add package Trellis.Mediator.FluentValidation
Quick Example
using FluentValidation;
using Trellis.Mediator;
using Trellis.Mediator.FluentValidation;
builder.Services.AddMediator(opts => opts.ServiceLifetime = ServiceLifetime.Scoped);
builder.Services.AddTrellisBehaviors();
builder.Services.AddTrellisFluentValidation();
builder.Services.AddScoped<IValidator<MyCommand>, MyCommandValidator>();
AddTrellisFluentValidation() registers FluentValidationMessageValidatorAdapter<TMessage> as the open-generic IMessageValidator<TMessage> implementation. Every IValidator<T> registered for the message in DI runs inside the existing ValidationBehavior<TMessage, TResponse> and contributes its failures to an aggregated Error.InvalidInput response. FluentValidation property names with member chains (Address.City) or indexers (Items[0].Sku) are translated to camelCase RFC 6901 JSON Pointers (/address/city, /items/0/sku).
Key Features
- Plugs into the existing Trellis validation behavior instead of adding another pipeline stage.
- Aggregates all registered validator failures into one
Error.InvalidInput. - Normalizes member chains and indexers to RFC 6901 JSON Pointers.
- Supports an AOT-safe parameterless registration with explicit validators.
AOT / trim story
The parameterless AddTrellisFluentValidation() overload is AOT- and trim-safe — it uses open-generic DI registration with no reflection. Validators must be registered explicitly:
services.AddScoped<IValidator<CreateOrderCommand>, CreateOrderCommandValidator>();
The AddTrellisFluentValidation(params Assembly[]) overload scans assemblies for IValidator<T> implementations via reflection and is annotated [RequiresUnreferencedCode] / [RequiresDynamicCode] — use the parameterless form in AOT scenarios.
Documentation
Part of Trellis
This package is part of the Trellis framework.
| 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
- FluentValidation (>= 12.1.1)
- Mediator.Abstractions (>= 3.0.2)
- Microsoft.Extensions.DependencyInjection (>= 10.0.12)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Options (>= 10.0.12)
- OpenTelemetry.Api (>= 1.19.1)
- Trellis.Core (>= 3.0.0-alpha.539)
- Trellis.FluentValidation (>= 3.0.0-alpha.539)
- Trellis.Mediator (>= 3.0.0-alpha.539)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Trellis.Mediator.FluentValidation:
| Package | Downloads |
|---|---|
|
Trellis.ServiceDefaults
Opinionated service composition defaults for Trellis web services. Provides a tiered builder that wires ASP integration, Mediator behaviors, FluentValidation, resource authorization, actor providers, and EF Core Unit of Work in canonical order. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 3.0.0-alpha.557 | 57 | 10/8/2026 |
| 3.0.0-alpha.554 | 38 | 10/8/2026 |
| 3.0.0-alpha.553 | 40 | 10/7/2026 |
| 3.0.0-alpha.542 | 105 | 10/5/2026 |
| 3.0.0-alpha.539 | 56 | 10/4/2026 |
| 3.0.0-alpha.532 | 89 | 10/2/2026 |
| 3.0.0-alpha.527 | 82 | 10/1/2026 |
| 3.0.0-alpha.526 | 55 | 9/30/2026 |
| 3.0.0-alpha.524 | 62 | 9/27/2026 |
| 3.0.0-alpha.520 | 73 | 9/25/2026 |
| 3.0.0-alpha.516 | 211 | 9/22/2026 |
| 3.0.0-alpha.513 | 67 | 9/22/2026 |
| 3.0.0-alpha.505 | 187 | 9/13/2026 |
| 3.0.0-alpha.495 | 238 | 8/24/2026 |
| 3.0.0-alpha.458 | 171 | 8/19/2026 |
| 3.0.0-alpha.455 | 134 | 8/19/2026 |
| 3.0.0-alpha.449 | 84 | 8/18/2026 |
| 3.0.0-alpha.447 | 85 | 8/18/2026 |
| 3.0.0-alpha.432 | 107 | 7/6/2026 |
| 3.0.0-alpha.428 | 103 | 7/3/2026 |