NexMediator 1.0.9

dotnet add package NexMediator --version 1.0.9
                    
NuGet\Install-Package NexMediator -Version 1.0.9
                    
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="NexMediator" Version="1.0.9" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NexMediator" Version="1.0.9" />
                    
Directory.Packages.props
<PackageReference Include="NexMediator" />
                    
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 NexMediator --version 1.0.9
                    
#r "nuget: NexMediator, 1.0.9"
                    
#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 NexMediator@1.0.9
                    
#: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=NexMediator&version=1.0.9
                    
Install as a Cake Addin
#tool nuget:?package=NexMediator&version=1.0.9
                    
Install as a Cake Tool

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/*

See Contributing Guide β†’


πŸ“„ 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 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. 
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
1.0.9 211 5/28/2025
1.0.8 467 5/12/2025

Initial 1.0.8 release with embedded DLLs of all sub-projects.