FlowMediator 2.0.1

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

FlowMediator is a lightweight, opinionated mediator library for .NET 8 and .NET 9.

It simplifies CQRS-style application flow by explicitly separating request-based operations (commands and queries) from event-driven side effects.

FlowMediator provides request/response messaging and pipeline behaviors with a predictable and transparent execution model.


Use FlowMediator when you want:

  • Clear separation between application flow and events
  • Simple request/response messaging without boilerplate
  • Predictable mediator behavior
  • A lightweight alternative to generic mediator frameworks

Installation

dotnet add package FlowMediator

Core Usage

Command / Query (SendAsync)

var user = await mediator.SendAsync(new GetUserByIdQuery(1));
  • Single handler
  • Pipeline-enabled (logging, validation, etc.)

Events (PublishAsync)

await mediator.PublishAsync(new UserCreatedEvent());
  • Multiple handlers supported
  • No response
  • Side-effect oriented

Event Dispatch Semantics

  • PublishAsync runs handlers sequentially (in-process) by default.
  • Handler order is not guaranteed unless explicitly controlled via registration/ordering.
  • If any handler throws, dispatch stops and the exception is re-thrown (remaining handlers won’t run).
  • Events are in-process notifications (not durable messaging). For reliable cross-service delivery, prefer Outbox / background worker / message broker patterns.

Key Concepts

  • SendAsync β†’ application flow (commands / queries)
  • PublishAsync β†’ event notifications
  • Events are not treated as requests
  • Pipelines apply only to SendAsync

Documentation

Full documentation, migration guide, and roadmap are available on GitHub: πŸ‘‰ https://github.com/berk2k/FlowMediator

License: MIT

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 is compatible.  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
2.0.1 94 1/26/2026
1.2.0 199 9/25/2025
1.0.0 242 8/26/2025

v2.0.1
   - Docs: clarified PublishAsync semantics (in-process, sequential; order not guaranteed unless controlled)
   - Docs: clarified exception behavior (stop and rethrow on handler exception)

   v2.0.0
   - Explicit separation between Send (application flow) and Publish (events)
   - Events are no longer treated as requests
   - Multiple event handlers supported
   - Pipeline applies only to SendAsync
   - Event handlers are executed sequentially (in-process) by default
   - Breaking change: migration from v1.x is required