Arcturus.Mediation
2026.3.15.316
dotnet add package Arcturus.Mediation --version 2026.3.15.316
NuGet\Install-Package Arcturus.Mediation -Version 2026.3.15.316
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="Arcturus.Mediation" Version="2026.3.15.316" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Arcturus.Mediation" Version="2026.3.15.316" />
<PackageReference Include="Arcturus.Mediation" />
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 Arcturus.Mediation --version 2026.3.15.316
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Arcturus.Mediation, 2026.3.15.316"
#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 Arcturus.Mediation@2026.3.15.316
#: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=Arcturus.Mediation&version=2026.3.15.316
#tool nuget:?package=Arcturus.Mediation&version=2026.3.15.316
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Arcturus.Mediation
This package provides a complete implementation of the Arcturus Mediation framework, enabling CQRS (Command Query Responsibility Segregation) patterns with middleware support and event publishing.
Features
- Request/Response Pattern: Send commands and queries with type-safe responses
- Middleware Pipeline: Add cross-cutting concerns like logging, validation, and authorization
- Event Publishing: Publish notifications to multiple handlers
- Dependency Injection: Built-in support for Microsoft.Extensions.DependencyInjection
Quick Start
1. Register Services
services.AddMediation(configuration =>
{
configuration.RegisterHandlersFromAssembly(typeof(Program).Assembly);
configuration.AddMiddleware<LoggingMiddleware>();
configuration.AddMiddleware<ValidationMiddleware>();
});
2. Define Requests and Handlers
// Query with response
public record GetUserQuery(int UserId) : IRequest<User>;
public class GetUserHandler : IRequestHandler<GetUserQuery, User>
{
public async Task<User> Handle(GetUserQuery request, CancellationToken cancellationToken)
{
// Implementation
return user;
}
}
// Command without response
public record DeleteUserCommand(int UserId) : IRequest;
public class DeleteUserHandler : IRequestHandler<DeleteUserCommand>
{
public async Task Handle(DeleteUserCommand request, CancellationToken cancellationToken)
{
// Implementation
}
}
3. Define Notifications and Handlers
public record UserDeletedNotification(int UserId) : INotification;
public class EmailNotificationHandler : INotificationHandler<UserDeletedNotification>
{
public async Task Handle(UserDeletedNotification notification, CancellationToken cancellationToken)
{
// Send email notification
}
}
public class AuditLogHandler : INotificationHandler<UserDeletedNotification>
{
public async Task Handle(UserDeletedNotification notification, CancellationToken cancellationToken)
{
// Log to audit system
}
}
4. Use the Mediator
public class UserController : ControllerBase
{
private readonly IMediator _mediator;
public UserController(IMediator mediator)
{
_mediator = mediator;
}
[HttpGet("{id}")]
public async Task<User> GetUser(int id)
{
return await _mediator.Send(new GetUserQuery(id));
}
[HttpDelete("{id}")]
public async Task DeleteUser(int id)
{
await _mediator.Send(new DeleteUserCommand(id));
await _mediator.Publish(new UserDeletedNotification(id));
}
}
Middleware
Create custom middleware to add cross-cutting concerns:
public class LoggingMiddleware : IMiddleware
{
private readonly ILogger<LoggingMiddleware> _logger;
public LoggingMiddleware(ILogger<LoggingMiddleware> logger)
{
_logger = logger;
}
public async Task InvokeAsync(IMiddlewareContext context, RequestDelegate next)
{
_logger.LogInformation("Handling request {RequestType}", context.RequestType.Name);
var stopwatch = Stopwatch.StartNew();
await next();
stopwatch.Stop();
_logger.LogInformation("Handled request {RequestType} in {ElapsedMs}ms",
context.RequestType.Name, stopwatch.ElapsedMilliseconds);
}
}
| Product | Versions 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 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
- Arcturus.Mediation.Abstracts (>= 2026.3.15.316)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.4)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.4)
-
net9.0
- Arcturus.Mediation.Abstracts (>= 2026.3.15.316)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.4)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.4)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Arcturus.Mediation:
| Package | Downloads |
|---|---|
|
Arcturus.Mediation.Sample
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2026.3.15.316 | 88 | 3/15/2026 |
| 2026.3.12.308 | 88 | 3/12/2026 |
| 2026.3.11.295 | 92 | 3/11/2026 |
| 2026.3.11.291 | 89 | 3/11/2026 |
| 2026.3.9.275 | 90 | 3/9/2026 |
| 2026.3.9.271 | 87 | 3/9/2026 |
| 2026.3.9.269 | 85 | 3/9/2026 |
| 2026.3.7.268 | 86 | 3/7/2026 |
| 2026.2.26.266 | 105 | 2/26/2026 |
| 2026.2.25.258 | 109 | 2/25/2026 |
| 2026.2.25.257 | 96 | 2/25/2026 |
| 2026.2.25.256 | 91 | 2/25/2026 |
| 2026.2.25.255 | 94 | 2/25/2026 |
| 2026.2.25.253 | 87 | 2/25/2026 |
| 2026.2.25.252 | 95 | 2/25/2026 |
| 2026.2.23.242 | 161 | 2/23/2026 |
| 2026.2.5.233 | 146 | 2/5/2026 |
| 2026.1.15.222 | 116 | 1/15/2026 |
| 2026.1.15.220 | 106 | 1/15/2026 |
| 2026.1.13.213 | 106 | 1/13/2026 |
Loading failed