Arbiter
A powerful, lightweight, and extensible implementation of the Mediator pattern and Command Query Responsibility Segregation (CQRS) for .NET applications.
Arbiter is designed for building clean, modular architectures like Vertical Slice Architecture and CQRS. It provides a comprehensive suite of libraries that work together to simplify complex application patterns while maintaining high performance and flexibility.

Key Features
- Clean Architecture: Perfect for Vertical Slice Architecture and CQRS patterns
- High Performance: Minimal overhead with efficient mediator implementation
- Extensible: Pipeline behaviors, custom handlers, and extensive customization options
- Observable: Built-in OpenTelemetry support for tracing and metrics
- Database Agnostic: Support for Entity Framework Core, MongoDB, and more
- Web Ready: Minimal API endpoints and MVC controller support
- Communication: Integrated email and SMS messaging capabilities
- Blazor Ready: First-class Dispatcher support for Blazor Auto, Server Interactive, and WebAssembly render modes
Table of Contents
Quick Start
Get started with Arbiter in just a few steps:
1. Install the Core Package
dotnet add package Arbiter.Mediation
2. Define a Request and Handler
// Define your request
public class GetUserQuery : IRequest<User>
{
public int UserId { get; set; }
}
// Implement the handler
public class GetUserHandler : IRequestHandler<GetUserQuery, User>
{
public async ValueTask<User?> Handle(GetUserQuery request, CancellationToken cancellationToken)
{
// Your business logic here
return await GetUserFromDatabase(request.UserId);
}
}
3. Register Services
services.AddMediator();
services.AddTransient<IRequestHandler<GetUserQuery, User>, GetUserHandler>();
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 { UserId = id });
}
}
Packages
Core Libraries Packages