RMediator.Abstractions
1.0.0
dotnet add package RMediator.Abstractions --version 1.0.0
NuGet\Install-Package RMediator.Abstractions -Version 1.0.0
<PackageReference Include="RMediator.Abstractions" Version="1.0.0" />
<PackageVersion Include="RMediator.Abstractions" Version="1.0.0" />
<PackageReference Include="RMediator.Abstractions" />
paket add RMediator.Abstractions --version 1.0.0
#r "nuget: RMediator.Abstractions, 1.0.0"
#:package RMediator.Abstractions@1.0.0
#addin nuget:?package=RMediator.Abstractions&version=1.0.0
#tool nuget:?package=RMediator.Abstractions&version=1.0.0
RMediator
As the famous MediatR package has turned into commercial, like many other people I propose my lightweight version of what MediatR offered the best over time.
Nothing fancy here, just basic stuff with the key features I've used the most and I still need to use in my different projects.
Install
RMediator
The all-in-one package:
dotnet add package RMediator
RMediator.Abstractions
A no-dependency package only referencing usable interfaces in order to keep core domain as pure and clean as possible:
dotnet add package RMediator.Abstractions
How to use it
Registration
Registration go through Microsoft classic dependency injection via the method below:
services
.AddMediator(o => o
.ScanAssemblies(
typeof(MyClass1).Assembly,
typeof(MyClass2).Assembly));
Middlewares can also be referenced in order here:
services
.AddMediator(o => o
.AddMiddlewares(
typeof(MonitorQuery),
typeof(CommitAfterCommand)));
The method .AddMediator(options => ...) can be called multiple times during services registration to allow splitted configuration if needed.
Implementation
This package allows to split the mediator pattern into the two core concepts of CQRS: command and query
IDispatchQuery / IDispatchCommandto inject in order to dispatch correspondingIQuery<TResponse> / ICommand / ICommand<TResult>IHandleQuery<TQuery, TResponse> / IHandleCommand<TCommand> / IHandleCommand<TCommand, TResult>to define the corresponding handlersIPublishDomainEventto inject in order to publishIDomainEventIListenToDomainEventto handle synchronously publishedIDomainEvent.IHandleMiddleware<TRequest> / IHandleMiddleware<TRequest, TResponse>to add specific behavior to given commands / queries / domain events.
All of the handlers support inheritance for more flexibility and behavior factorization. Middlewares also support genericity and constraints to fine-tune your pipelines.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
-
net10.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on RMediator.Abstractions:
| Package | Downloads |
|---|---|
|
RMediator.DependencyInjection
A simple implementation of the Mediator pattern with commands, queries, events and pipeline handlers. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 264 | 8/5/2026 |