Trellis.Mediator.FluentValidation
3.0.0-alpha.425
dotnet add package Trellis.Mediator.FluentValidation --version 3.0.0-alpha.425
NuGet\Install-Package Trellis.Mediator.FluentValidation -Version 3.0.0-alpha.425
<PackageReference Include="Trellis.Mediator.FluentValidation" Version="3.0.0-alpha.425" />
<PackageVersion Include="Trellis.Mediator.FluentValidation" Version="3.0.0-alpha.425" />
<PackageReference Include="Trellis.Mediator.FluentValidation" />
paket add Trellis.Mediator.FluentValidation --version 3.0.0-alpha.425
#r "nuget: Trellis.Mediator.FluentValidation, 3.0.0-alpha.425"
#:package Trellis.Mediator.FluentValidation@3.0.0-alpha.425
#addin nuget:?package=Trellis.Mediator.FluentValidation&version=3.0.0-alpha.425&prerelease
#tool nuget:?package=Trellis.Mediator.FluentValidation&version=3.0.0-alpha.425&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).
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.9)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.9)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.9)
- Microsoft.Extensions.Options (>= 10.0.9)
- OpenTelemetry.Api (>= 1.16.0)
- Trellis.Core (>= 3.0.0-alpha.425)
- Trellis.FluentValidation (>= 3.0.0-alpha.425)
- Trellis.Mediator (>= 3.0.0-alpha.425)
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.425 | 60 | 6/27/2026 |
| 3.0.0-alpha.419 | 51 | 6/24/2026 |
| 3.0.0-alpha.418 | 122 | 6/23/2026 |
| 3.0.0-alpha.417 | 47 | 6/23/2026 |
| 3.0.0-alpha.397 | 68 | 6/18/2026 |
| 3.0.0-alpha.396 | 56 | 6/18/2026 |
| 3.0.0-alpha.394 | 77 | 6/18/2026 |
| 3.0.0-alpha.385 | 65 | 6/15/2026 |
| 3.0.0-alpha.382 | 64 | 6/12/2026 |
| 3.0.0-alpha.372 | 65 | 6/10/2026 |
| 3.0.0-alpha.360 | 82 | 6/7/2026 |
| 3.0.0-alpha.342 | 72 | 6/5/2026 |