Nerdigy.Mediator
1.0.0
dotnet add package Nerdigy.Mediator --version 1.0.0
NuGet\Install-Package Nerdigy.Mediator -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="Nerdigy.Mediator" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nerdigy.Mediator" Version="1.0.0" />
<PackageReference Include="Nerdigy.Mediator" />
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 Nerdigy.Mediator --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Nerdigy.Mediator, 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 Nerdigy.Mediator@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=Nerdigy.Mediator&version=1.0.0
#tool nuget:?package=Nerdigy.Mediator&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Mediator
Nerdigy.Mediator is a mediator runtime for .NET, with support for request/response, notifications, and async streaming workflows.
Packages In This Repository
Nerdigy.Mediator: core mediator runtime, dispatch, pipelines, and publishersNerdigy.Mediator.Contracts: public contracts and delegate typesNerdigy.Mediator.DependencyInjection: DI registration, assembly scanning, and options
All projects currently target net10.0.
Quick Start
using Microsoft.Extensions.DependencyInjection;
using Nerdigy.Mediator.Contracts;
using Nerdigy.Mediator.DependencyInjection;
var services = new ServiceCollection();
services.AddMediator(options =>
{
options.RegisterServicesFromAssemblyContaining<PingHandler>();
});
await using var provider = services.BuildServiceProvider();
var mediator = provider.GetRequiredService<IMediator>();
var response = await mediator.Send(new PingQuery("hello"));
Console.WriteLine(response);
public sealed record PingQuery(string Message) : IRequest<string>;
public sealed class PingHandler : IRequestHandler<PingQuery, string>
{
public Task<string> Handle(PingQuery request, CancellationToken cancellationToken)
{
return Task.FromResult($"PONG: {request.Message}");
}
}
Repository Layout
src/Nerdigy.Mediator.Contractssrc/Nerdigy.Mediatorsrc/Nerdigy.Mediator.DependencyInjectiontest/Nerdigy.Mediator.UnitTeststest/Nerdigy.Mediator.IntegrationTestsbench/Nerdigy.Mediator.Benchmarksdocs/(VitePress documentation site)
Common Commands
Run from repository root:
dotnet build Mediator.slnx
dotnet test Mediator.slnx
dotnet format --verify-no-changes
dotnet run -c Release --project bench/Nerdigy.Mediator.Benchmarks/Nerdigy.Mediator.Benchmarks.csproj
Docs site:
pnpm docs:dev
pnpm docs:build
pnpm docs:preview
What Is Implemented
- Request/response and void-request dispatch (
Send) - Notification fan-out (
Publish) with sequential and parallel publisher strategies - Stream request dispatch (
CreateStream) - Request and stream pipeline behaviors
- Request and stream exception handlers, plus exception actions
- Assembly scanning for handlers, processors, behaviors, and exception components
Documentation
- Getting Started
- Dependency Injection
- Requests
- Notifications
- Streaming
- Pipelines And Processors
- Exception Handling
- Performance
- Troubleshooting
Contributing Notes
- Follow
.editorconfigand namespace-to-path alignment (namespace == path). - Keep changes small and single-purpose.
- Maintain independent implementation practices and do not copy source from external projects.
License
| 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Nerdigy.Mediator.Contracts (>= 1.0.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Nerdigy.Mediator:
| Package | Downloads |
|---|---|
|
Nerdigy.Mediator.DependencyInjection
Dependency injection registration, assembly scanning, and runtime options for Nerdigy mediator. |
GitHub repositories
This package is not used by any popular GitHub repositories.