OSS TanbouSign in with GitHub

An in-process mediator library for decoupling requests, notifications, and events in .NET applications

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
11,856
Primary language
C#
License
Not determined
Repository last updated
Jul 2, 2026
On this page

Overview

MediatR is a library for dispatching work inside a .NET application without coupling senders to concrete handlers. It covers request/response, commands, queries, notifications, and events with synchronous and asynchronous dispatch, and it can register handlers through Microsoft.Extensions.DependencyInjection. It provides a small mediation layer for structuring in-process application boundaries.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Key features

Use one dispatch model for request/response and fan-out notifications

The library supports request/response, commands, queries, notifications, and events. It handles synchronous and asynchronous dispatch and uses C# generic variance, allowing callers to send work without directly referencing a concrete handler.

Sources: [1]

Add handler discovery and cross-cutting behavior through dependency injection

MediatR integrates directly with Microsoft.Extensions.DependencyInjection and scans selected assemblies for request, notification, and stream handlers. Pipeline behaviors, stream behaviors, pre-processors, post-processors, and exception handlers provide extension points for validation, logging, and other cross-cutting work.

Sources: [1]

Best fit

Fits applications that need explicit use-case boundaries without direct handler dependencies

It is a candidate for web APIs and business applications that want controllers or views to depend on a sender abstraction rather than individual use-case classes. It also fits command/query separation, fan-out domain notifications, and shared validation or auditing pipelines.

Before adoption

Treat it as in-process mediation and review the current licensing model

MediatR provides in-process messaging. It does not replace a broker that transports messages between services, persists them, or retries delivery, so distributed systems need a separate transport and reliability design.

The v14.2.0 README documents license-key configuration and license-warning filtering. Source and binaries are offered under RPL-1.5, with a separate License Agreement offered when software built with them will not be released under those reciprocal terms. Review the distribution model and license obligations before adoption.

Sources: [1][2][3]

Official sources

  1. [1]LuckyPennySoftware/MediatR — README at v14.2.0(2026-10-04)
  2. [2]LuckyPennySoftware/MediatR — LICENSE at v14.2.0(2026-10-04)
  3. [3]MediatR v14.2.0 release(2026-10-04)
Supplemental curator note

The comparison should cover not only reduced coupling but also whether important control flow becomes too indirect for the team. For current v14 releases, licensing belongs in the adoption review alongside architecture.

Try it in 3 steps

  1. 1

    Clone the v14.2.0 source

    Use the fixed tag that contains the official examples.

    git clone --branch v14.2.0 --depth 1 https://github.com/LuckyPennySoftware/MediatR.git
  2. 2

    Enter the repository

    Move to the root that contains the ASP.NET Core DI example.

    cd MediatR
  3. 3

    Run the DI example

    Use the .NET 10 SDK to build the official net10.0 ASP.NET Core sample and inspect its request, notification, pipeline, and stream output.

    dotnet run --project samples/MediatR.Examples.AspNetCore/MediatR.Examples.AspNetCore.csproj
Check the official README

Growth

Growth trends · Last 30 days

11,856 Stars

Trend data is still being collected.

Development activity

Last 90 days · weekly

Commits (last 30 days)
0
Open PRs
0

Development activity is still being collected.

Built with

Categories and tags

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • hacktoberfest
Stars
11,856
Forks
2,180
Watchers
291
Open issues
3
Contributors
79
Owner type
Organization
Primary language
C#
License
Not determined
Repository last updated
Jul 2, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?