NetCoreBackend.NArchitecture.Core.Mediation 1.0.0

dotnet add package NetCoreBackend.NArchitecture.Core.Mediation --version 1.0.0
                    
NuGet\Install-Package NetCoreBackend.NArchitecture.Core.Mediation -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NetCoreBackend.NArchitecture.Core.Mediation" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NetCoreBackend.NArchitecture.Core.Mediation" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="NetCoreBackend.NArchitecture.Core.Mediation" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NetCoreBackend.NArchitecture.Core.Mediation --version 1.0.0
                    
#r "nuget: NetCoreBackend.NArchitecture.Core.Mediation, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NetCoreBackend.NArchitecture.Core.Mediation@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NetCoreBackend.NArchitecture.Core.Mediation&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=NetCoreBackend.NArchitecture.Core.Mediation&version=1.0.0
                    
Install as a Cake Tool

NetCoreBackend.NArchitecture.Core.Mediation

Minimal, license-free in-process mediator for CQRS-style request dispatch and pipeline behaviors. It is a drop-in replacement for the subset of MediatR the framework uses — no commercial license, ~150 lines, full control.

What it provides

Type Purpose
IRequest<TResponse> / IRequest Marker for a request returning a value / a void command
IRequestHandler<TRequest, TResponse> Handler for value-returning requests
IRequestHandler<TRequest> Handler for void commands (Task Handle, bridged to Unit via DIM)
IPipelineBehavior<TRequest, TResponse> Middleware contract wrapping handler execution
RequestHandlerDelegate<TResponse> next(ct) delegate passed to behaviors
Unit The "no value" return for void commands
IMediator Entry point: Send(request, ct)
AddMediator(params Assembly[]) DI registration — scans assemblies for handlers

Usage

// Composition root
builder.Services.AddMediator(typeof(Program).Assembly);

// Pipeline behaviors (registration order = execution order; first registered runs outermost)
builder.Services.AddScoped(typeof(IPipelineBehavior<,>), typeof(MyBehavior<,>));

Design notes

This is not a copy of MediatR 14. It deliberately mirrors MediatR 11 semantics (IRequest : IRequest<Unit> plus a Default Interface Method bridge for void handlers) so that void commands route through a single Unit path. Void command handlers must implement only Task Handle(...); the two-parameter Task<Unit> Handle(...) is supplied by the DIM bridge and must not be hand-implemented.

Mediator must be registered as Scoped (done by AddMediator) — never Singleton — so the injected IServiceProvider can resolve scoped handlers.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on NetCoreBackend.NArchitecture.Core.Mediation:

Package Downloads
NetCoreBackend.NArchitecture.Core.Application

Provide CQRS, Mediation, Pipelines, DTOs, and more for the Application Layer.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 146 6/23/2026