FlowMediator 2.0.1
dotnet add package FlowMediator --version 2.0.1
NuGet\Install-Package FlowMediator -Version 2.0.1
<PackageReference Include="FlowMediator" Version="2.0.1" />
<PackageVersion Include="FlowMediator" Version="2.0.1" />
<PackageReference Include="FlowMediator" />
paket add FlowMediator --version 2.0.1
#r "nuget: FlowMediator, 2.0.1"
#:package FlowMediator@2.0.1
#addin nuget:?package=FlowMediator&version=2.0.1
#tool nuget:?package=FlowMediator&version=2.0.1
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 | 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 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. |
-
net8.0
- Microsoft.Extensions.DependencyInjection (>= 9.0.8)
-
net9.0
- Microsoft.Extensions.DependencyInjection (>= 9.0.8)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
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