NexMediator 1.0.9
dotnet add package NexMediator --version 1.0.9
NuGet\Install-Package NexMediator -Version 1.0.9
<PackageReference Include="NexMediator" Version="1.0.9" />
<PackageVersion Include="NexMediator" Version="1.0.9" />
<PackageReference Include="NexMediator" />
paket add NexMediator --version 1.0.9
#r "nuget: NexMediator, 1.0.9"
#:package NexMediator@1.0.9
#addin nuget:?package=NexMediator&version=1.0.9
#tool nuget:?package=NexMediator&version=1.0.9
NexMediator
<p align="center"> <img src="https://raw.githubusercontent.com/wiki/vagnerjsmello/NexMediator/assets/logo-nexmediator.png" alt="NexMediator logo" width="150" /> </p>
<p align="center"><strong>A modern, extensible, and high-performance .NET library for clean CQRS applications.</strong></p>
<p align="center"> <a href="https://www.nuget.org/packages/NexMediator"><img src="https://img.shields.io/nuget/v/NexMediator?style=flat-square" alt="NuGet version" /></a> <a href="https://vagnerjsmello.github.io/NexMediator/"><img src="https://img.shields.io/endpoint?url=https://vagnerjsmello.github.io/NexMediator/badge-summary.json&style=flat-square" alt="Coverage report" /></a> <img src="https://img.shields.io/badge/.NET-8.0-blueviolet?style=flat-square" /> <img src="https://img.shields.io/badge/C%23-12.0-brightgreen?style=flat-square" /> <img src="https://img.shields.io/badge/Pattern-CQRS-blue?style=flat-square" /> <img src="https://img.shields.io/badge/Architecture-DDD-purple?style=flat-square" /> <img src="https://img.shields.io/badge/Tested%20with-TDD-success?style=flat-square" /> <img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=flat-square" /> </p>
π Overview
NexMediator is a clean, modular, and pluggable mediator engine for .NET 8+ applications β a robust alternative to MediatR with:
- β Built-in pipeline behaviors (logging, validation, caching, transactions)
- π£ Parallel notifications
- π‘ Async streaming with
IAsyncEnumerable<T> - π§© Full DI support and testable architecture
- β‘ Compiled delegates (no runtime reflection)
Inspired by CQRS, Clean Architecture and DDD.
π¦ Installation
Install via CLI:
dotnet add package NexMediator
Or via NuGet:
NuGet\Install-Package NexMediator
π Quick Start
builder.Services.AddNexMediator();
This registers the core engine and auto-discovers all handlers.
π§± Built-in Pipeline Behaviors
You can add any of the built-in behaviors:
builder.Services.AddNexMediator(options =>
{
options.AddBehavior(typeof(LoggingBehavior<,>), 1);
options.AddBehavior(typeof(FluentValidationBehavior<,>), 2);
options.AddBehavior(typeof(CachingBehavior<,>), 3);
options.AddBehavior(typeof(TransactionBehavior<,>), 4);
});
| Behavior | Description |
|---|---|
LoggingBehavior<,> |
Logs execution details and correlation ID |
FluentValidation<,> |
Validates using FluentValidation |
CachingBehavior<,> |
Adds response-level caching support |
TransactionBehavior<,> |
Wraps command in transaction scope |
π§© Want to customize? You can implement your own
INexPipelineBehavior<TRequest, TResponse>
and register it with any order:
options.AddBehavior(typeof(MyCustomBehavior<,>), 99);
π Documentation
π Complete guides, examples and usage patterns available in the Wiki:
π https://github.com/vagnerjsmello/NexMediator/wiki
Includes:
- Core concepts (requests, handlers, notifications, streams)
- Usage with Minimal APIs
- Real-world example: AuctionBoardGame
- Custom behaviors, caching, transactions
- Error handling, correlation ID, tests
π€ Contributing
We welcome contributions!
Star β the repo, suggest improvements, or submit PRs via feature/* branches.
β
Use Conventional Commits
π¦ Follow our branch strategy: main, develop, feature/*
π License
Apache 2.0 License β free for commercial and open source use.
Β© 2024β2025 Vagner Mello
π LinkedIn
π· Tags
.NET β’ C# β’ CQRS β’ Mediator β’ Open Source β’ NuGet β’ Clean Architecture β’ Pipeline β’ Notifications β’ Streaming β’ Validation β’ Transactions β’ TDD β’ DDD
| Product | Versions 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 was computed. 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. |
-
net8.0
- FluentValidation (>= 12.0.0)
- Microsoft.Extensions.DependencyInjection (>= 8.0.1)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
- Scrutor (>= 6.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial 1.0.8 release with embedded DLLs of all sub-projects.