DelegatR 0.1.0-preview.1

This is a prerelease version of DelegatR.
dotnet add package DelegatR --version 0.1.0-preview.1
                    
NuGet\Install-Package DelegatR -Version 0.1.0-preview.1
                    
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="DelegatR" Version="0.1.0-preview.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DelegatR" Version="0.1.0-preview.1" />
                    
Directory.Packages.props
<PackageReference Include="DelegatR" />
                    
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 DelegatR --version 0.1.0-preview.1
                    
#r "nuget: DelegatR, 0.1.0-preview.1"
                    
#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 DelegatR@0.1.0-preview.1
                    
#: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=DelegatR&version=0.1.0-preview.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=DelegatR&version=0.1.0-preview.1&prerelease
                    
Install as a Cake Tool

DelegatR

DelegatR is a minimal, in-process mediator for .NET.

It provides a small set of contracts plus a single default runtime Mediator implementation that can dispatch requests and publish notifications. Resolution is DI-agnostic via a ServiceFactory delegate.

V1 scope

  • Send:
    • Dispatch a request to exactly one handler
    • Optional pipeline behaviors that wrap the handler
    • Cancellation token flows through behaviors and handler
  • Publish:
    • Resolve all handlers for the concrete notification type
    • Execute sequentially in resolver order
    • Stop on the first exception
  • ServiceFactory:
    • A delegate-based abstraction for resolving services from any container (or your own resolver)

Out of scope (V1)

  • Streaming requests / async enumerable responses
  • Advanced publish strategies (parallelism, exception aggregation, fire-and-forget)
  • Assembly scanning / auto-registration helpers
  • Built-in logging/metrics (use pipeline behaviors instead)
  • Licensing or license enforcement

Conceptual usage (high level)

  1. Define a request type that implements IRequest<TResponse>.
  2. Implement a handler for it using IRequestHandler<TRequest, TResponse>.
  3. (Optional) Register one or more IPipelineBehavior<TRequest, TResponse> to wrap Send.
  4. Provide a ServiceFactory that can resolve:
    • The request handler for the concrete request type
    • The pipeline behavior sequence for that request type
    • The notification handlers sequence for the concrete notification type
  5. Create new Mediator(factory) and call Send / Publish.

Packaging

The library is designed to be packed as a NuGet package from src/DelegatR.

Examples

See examples/DelegatR.Examples.Console for a small console app demonstrating:

  • Send with a request/handler
  • Publish with two notification handlers (sequential execution)
  • A simple pipeline behavior wrapping Send

Documentation

  • documents/why-delegatr.md
  • documents/migration-notes.md

License

MIT is recommended for this repository (add a LICENSE file when ready).

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-preview.1 181 12/22/2025
0.1.0-preview 172 12/23/2025