MediatRaptor 1.0.0
dotnet add package MediatRaptor --version 1.0.0
NuGet\Install-Package MediatRaptor -Version 1.0.0
<PackageReference Include="MediatRaptor" Version="1.0.0" />
<PackageVersion Include="MediatRaptor" Version="1.0.0" />
<PackageReference Include="MediatRaptor" />
paket add MediatRaptor --version 1.0.0
#r "nuget: MediatRaptor, 1.0.0"
#:package MediatRaptor@1.0.0
#addin nuget:?package=MediatRaptor&version=1.0.0
#tool nuget:?package=MediatRaptor&version=1.0.0
๐ฆ MediatRaptor
MediatRaptor is a lightweight and extensible implementation of the Mediator pattern with built-in support for CQRS (Command Query Responsibility Segregation). It is designed as a modern, minimal alternative to heavier mediator libraries, providing developers with a clean and structured way to implement Commands, Queries, Notifications, and Handlers.
The library emphasizes:
- ๐ฆ Lightweight โ No unnecessary dependencies, minimal overhead.
- ๐ฆ Mediator-first โ Core focus on mediator pattern with request/response pipelines.
- โก CQRS-ready โ First-class support for commands and queries.
- ๐ ๏ธ Extensible โ Add behaviors like logging, validation, or caching with pipeline decorators.
- โ Test-friendly โ Promotes separation of concerns and easy testing of handlers.
MediatRaptor is a lightweight implementation of the Mediator pattern with built-in support for CQRS (Command/Query Responsibility Segregation).
Inspired by MediatR, but built to be minimal, extensible, and fun.
โจ Features
- ๐ฆ Clean Mediator abstraction (
IMediator) - โก CQRS-ready (Commands, Queries, Notifications)
- ๐ Pipeline behaviors (logging, validation, caching, etc.)
- ๐ ๏ธ No external dependencies โ minimal and fast
- โ Easy to test, extend, and integrate
๐ Getting Started
1. Define a Command
public record CreateUserCommand(string Username, string Email) : ICommand<Guid>;
2. Create a Handler
public class CreateUserHandler : ICommandHandler<CreateUserCommand, Guid>
{
public Task<Guid> Handle(CreateUserCommand command, CancellationToken ct)
{
// business logic
return Task.FromResult(Guid.NewGuid());
}
}
3. Use the Mediator
var mediator = new MediatorRaptor(cfg =>
{
cfg.RegisterHandlers(typeof(CreateUserHandler).Assembly);
});
var userId = await mediator.Send(new CreateUserCommand("hasan", "test@example.com"));
๐งช Examples
Check the examples/ folder for runnable projects:
- ConsoleApp โ basic CQRS setup with commands, queries, and handlers
๐ License
MIT โ free to use, modify, and share.
| 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 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. |
-
net9.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.8)
- Scrutor (>= 6.1.0)
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 |
|---|---|---|
| 1.0.0 | 228 | 9/10/2025 |