Skip to main content
.NET 7 · .NET 8 · .NET 9

Vali-Mediator

// mediator pattern for .NET

6packages
CQRS+ pipeline
Result<T> pattern
$dotnet add package Vali-Mediator

Everything you need for the Mediator pattern

Built for .NET developers who value clarity, resilience and observability.

01

CQRS & Mediator

IRequest, INotification, IFireAndForget, IStreamRequest — clean separation of commands, queries and events out of the box.

02

Pipeline Behaviors

Compose IPipelineBehavior layers — logging, validation, caching, idempotency — without touching your handlers.

03
🛡

Resilience Policies

Retry, CircuitBreaker, Timeout, Bulkhead, Hedge, RateLimiter, Chaos, Fallback — fluent builder, zero extra dependencies.

04

Result Pattern

Result<T> and Result with Map, Bind, Match, Tap, OnFailure — typed error handling without exceptions.

05

Caching & Idempotency

ICacheable, IInvalidatesCache, IIdempotent — declarative caching and idempotent requests as pipeline behaviors.

06

OpenTelemetry Ready

Built-in ActivitySource, IMetricsCollector, IRequestObserver — plug in your tracing backend in one line.

See it in action

Send queries, handle results, compose behaviors — all in a few lines.

Program.cs
services.AddValiMediator(cfg => cfg
.AddBehavior<LoggingBehavior>()
.AddBehavior<ValidationBehavior>());
 
// Send a query
var result = await mediator.Send(new GetUserQuery(userId));
 
result.Match(
onSuccess: user => Ok(user),
onFailure: err => Problem(err.Message));

6 NuGet packages. Install only what you need.

Each package is independent — add the features your project requires.

Core mediator, CQRS, Result pattern, pipeline, streaming.

dotnet add package Vali-Mediator

Retry, CircuitBreaker, Timeout, Bulkhead, Hedge, RateLimiter, Chaos, Fallback.

dotnet add package Vali-Mediator.Resilience

Declarative pipeline caching with ICacheable and IInvalidatesCache.

dotnet add package Vali-Mediator.Caching

OpenTelemetry ActivitySource, metrics collector, request observers.

dotnet add package Vali-Mediator.Observability

Idempotent request handling via IIdempotent and IIdempotencyStore.

dotnet add package Vali-Mediator.Idempotency

Maps Result<T> to HTTP responses for controllers and Minimal APIs.

dotnet add package Vali-Mediator.AspNetCore
FM
Built byFelipe Rafael Montenegro Morriberon

.NET developer and open-source enthusiast. Creator of Vali-Mediator and Vali-Validation.