Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Core
  3. MediatR.Extensions.Microsoft.DependencyInjection

MediatR.Extensions.Microsoft.DependencyInjection

MITC#v11.1.0

Adds MediatR support to Microsoft's dependency injection container for .NET applications.

GitHubGitHub
326 stars104 forks0 contributors

What is MediatR.Extensions.Microsoft.DependencyInjection?

MediatR.Extensions.Microsoft.DependencyInjection is a .NET library that integrates the MediatR mediator pattern implementation with Microsoft's dependency injection container. It provides extension methods to automatically register MediatR handlers and related components, simplifying the setup process for applications using the mediator pattern.

Target Audience

.NET developers building applications with clean architecture patterns who want to use MediatR with Microsoft's built-in dependency injection container.

Value Proposition

This extension eliminates boilerplate code for registering MediatR components and ensures proper service lifetime management, making it easier to adopt the mediator pattern in ASP.NET Core and other .NET applications.

Overview

MediatR extensions for Microsoft.Extensions.DependencyInjection

Use Cases

Best For

  • Setting up MediatR in ASP.NET Core applications
  • Implementing clean architecture patterns in .NET projects
  • Reducing boilerplate code for dependency injection configuration
  • Automating registration of request handlers and pipeline behaviors
  • Building maintainable applications with separated concerns
  • Integrating mediator pattern with Microsoft's DI container

Not Ideal For

  • New projects after the archive date, as the functionality is now integrated into the main MediatR repository.
  • Applications using dependency injection containers other than Microsoft's built-in one, such as Autofac or Simple Injector.
  • Teams needing manual control over service registration without automatic assembly scanning.

Pros & Cons

Pros

Automatic Service Registration

Automatically registers all MediatR handlers, pre/post processors, and pipeline behaviors, eliminating boilerplate code for DI setup as highlighted in the key features.

Easy Configuration Methods

Provides AddMediatR() extension methods for straightforward integration with Microsoft's DI container, simplifying configuration in just a few lines.

Assembly Scanning Support

Supports automatic discovery and registration of handlers from specified assemblies, reducing manual work and errors in service registration.

Proper Lifetime Management

Configures appropriate service lifetimes for MediatR components within the DI container, ensuring correct dependency resolution and performance.

Cons

Archived and Deprecated

The project is no longer maintained; functionality has been moved to the main MediatR repository, making this extension obsolete for new development.

Microsoft DI Exclusive

Only integrates with Microsoft's built-in dependency injection container, limiting flexibility for projects using other DI frameworks like Autofac or StructureMap.

Limited Customization

Automatic assembly scanning may not handle complex registration scenarios or custom handler configurations without additional manual intervention.

Frequently Asked Questions

Quick Stats

Stars326
Forks104
Contributors0
Open Issues19
Last commit3 years ago
CreatedSince 2016

Tags

#request-handling#dependency-injection#service-registration#csharp#mediator-pattern#dotnet#aspnet-core#microservices#clean-architecture

Built With

M
Microsoft.Extensions.DependencyInjection
.
.NET

Included in

Core21.2k
Auto-fetched 9 hours ago

Related Projects

MediatRMediatR

Simple, unambitious mediator implementation in .NET

Stars11,831
Forks2,200
Last commit22 hours ago
Event StoreEvent Store

KurrentDB is a database that's engineered for modern software applications and event-driven architectures. Its event-native design simplifies data modeling and preserves data integrity while the integrated streaming engine solves distributed messaging challenges and ensures data consistency.

Stars5,792
Forks674
Last commit2 days ago
MQTTnetMQTTnet

MQTTnet is a high performance .NET library for MQTT based communication. It provides a MQTT client and a MQTT server (broker). The implementation is based on the documentation from http://mqtt.org/.

Stars4,988
Forks1,149
Last commit3 months ago
NetMQNetMQ

A 100% native C# implementation of ZeroMQ for .NET

Stars3,165
Forks766
Last commit15 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub