Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
F

FluentMediator

> DevOps
Open source

:twisted_rightwards_arrows: FluentMediator is an unobtrusive library that allows developers to build custom pipelines for Commands, Queries and Events.

196 stars0 likes2 views
WebsiteGitHub

About

:twisted_rightwards_arrows: FluentMediator is an unobtrusive library that allows developers to build custom pipelines for Commands, Queries and Events.

FluentMediator

:twisted_rightwards_arrows: We will not require you to add dependencies into your domain or to implement frameworks interfaces in your event handlers. Finally a really loosely coupled mediator library was born.

Install

Install-Package FluentMediator

For seameless .NET Core integration:

Install-Package FluentMediator.Microsoft.Extensions.DependencyInjection

How

Setup your events and pipelines using depedency injection. You can be very creative here! It supports async methods and cancellable tokens parameters, you could append multiple steps select one to return a message. An example:

csharp
services.AddFluentMediator(builder => {
    builder.On().Pipeline()
        .Call((handler, request) => handler.MyMethod(request))
        .Call((handler, request) => handler.MyLongMethod(request))
        .Return(
            (handler, request) => handler.MyOtherMethod(request)
        );
});

Then you are able to use the injected IMediator interface.

Publishing Events

csharp
// Puts the message in the pipeline, calls three handlers.
mediator.Publish(ping);

Sending Commands and Queries

csharp
// Calls the three handlers then get the response from `MyOtherMethod(PingRequest)`.
PingResponse response = mediator.Send(new PingRequest("Ping"));
Console.WriteLine(response.Message); // Prints "Pong"

Why

When designing CQRS or Event-Driven applications we need to publish events from the infrastructure layer into the domain event handlers. We do not want framework dependencies leaking out to the Model then FluentMediator was born.

Contributors

Ivan Paulovich ⚠️

Joakim Carselind

Vaggelis Mparmpas ⚠️

Please contribute with Issues, Wiki and Samples.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C#chain-methodschain-of-responsibilitycraftmanshipcsharp

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
CategoryDevOps
PricingOpen source

> Related tools

D
Docker
容器化平台,标准化应用交付
G
GitHub Actions
GitHub 原生 CI/CD 工作流
N
Nginx
高性能 Web 服务器与反向代理