DomainRelay 3.1.3

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

DomainRelay

Core mediator implementation for Clean Architecture.

Install

  • DomainRelay.Abstractions
  • DomainRelay
  • DomainRelay.DependencyInjection

Optionals:

  • DomainRelay.Diagnostics
  • DomainRelay.Validation
  • DomainRelay.EFCore
  • DomainRelay.Transport.RabbitMQ

Quick start

Register DomainRelay and scan assemblies containing your handlers:

using DomainRelay.DependencyInjection;
using DomainRelay.Publish;

services.AddDomainRelay(
    configureOptions: o =>
    {
        // Notifications publish strategy (default: SequentialPublishStrategy)
        // o.PublishStrategy = new ParallelPublishStrategy();
    },
    configureRegistration: reg =>
    {
        reg.Assemblies.Add(typeof(Program).Assembly);
        // reg.Assemblies.Add(typeof(SomeHandler).Assembly);
    });

Send (Commands / Queries)

using DomainRelay.Abstractions;

public sealed record CreateUser(string Email) : IRequest<Unit>;

public sealed class CreateUserHandler : IRequestHandler<CreateUser, Unit>
{
    public Task<Unit> Handle(CreateUser request, CancellationToken ct)
        => Task.FromResult(Unit.Value);
}

await mediator.Send(new CreateUser("a@b.com"), ct);

Publish (Notifications)

using DomainRelay.Abstractions;

public sealed record UserCreated(Guid UserId) : INotification;

public sealed class SendWelcomeEmail : INotificationHandler<UserCreated>
{
    public Task Handle(UserCreated notification, CancellationToken ct) => Task.CompletedTask;
}

await mediator.Publish(new UserCreated(userId), ct);

Pipeline behaviors

Behaviors wrap request handlers (validation, transactions, diagnostics, etc.):

using DomainRelay.Abstractions;

public sealed class TimingBehavior<TRequest, TResponse> : IPipelineBehavior<TRequest, TResponse>
    where TRequest : IRequest<TResponse>
{
    public async Task<TResponse> Handle(TRequest request, CancellationToken ct, HandlerDelegate<TResponse> next)
        => await next();
}

services.AddTransient(typeof(IPipelineBehavior<,>), typeof(TimingBehavior<,>));
  • DomainRelay.DependencyInjection for AddDomainRelay(...)
  • DomainRelay.Diagnostics for ActivitySource tracing
  • DomainRelay.Validation for FluentValidation integration
  • DomainRelay.EFCore for transactions + Outbox
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on DomainRelay:

Package Downloads
DomainRelay.DependencyInjection

Microsoft.Extensions.DependencyInjection integration for DomainRelay.

DomainRelay.Diagnostics

Diagnostics (Activity/Tracing) behavior for DomainRelay.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.1.3 53 5/25/2026
3.1.2 43 5/24/2026
3.1.1 217 4/26/2026
3.1.0 121 4/25/2026
3.0.1 120 4/24/2026
3.0.0 120 4/24/2026
2.0.1 431 3/6/2026
2.0.0 130 3/5/2026
1.0.2-alpha.4 57 3/5/2026
1.0.1-alpha.4 61 3/5/2026
1.0.0 135 3/5/2026