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.
Official sources
- [1]LuckyPennySoftware/MediatR — README at v14.2.0(2026-10-04)
- [2]LuckyPennySoftware/MediatR — LICENSE at v14.2.0(2026-10-04)
- [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
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
Enter the repository
Move to the root that contains the ASP.NET Core DI example.
cd MediatR - 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
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
Categories
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
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- SWR32,488 Stars
1 shared tag(s) · 1 shared category(s)
cache remote React data and manage revalidation, deduplication, and updates through hooks
TypeScript - Pydantic28,935 Stars
1 shared tag(s) · 1 shared category(s)
connect Python type hints to runtime data validation
Python - OpenAPI Generator26,771 Stars
1 shared tag(s) · 1 shared category(s)
Generate client SDKs, server stubs, documentation, and configuration for many languages from one OpenAPI contract
Java - Actix Web24,853 Stars
1 shared tag(s) · 1 shared category(s)
build high-performance HTTP APIs and WebSocket services in Rust on the Tokio async ecosystem
Rust - Alamofire42,406 Stars
1 shared tag(s) · 2 shared category(s)
build Swift HTTP networking on URLSession with concise requests, retries, uploads, downloads, and TLS pinning
Swift - tRPC40,686 Stars
1 shared tag(s) · 2 shared category(s)
Carry server types to clients and catch API mismatches during development
TypeScript
Report incorrect information
Tell us if any listing information is incorrect or outdated.