https://github.com/henningtandberg/mando
A super lightweight and free alternative to libraries that provide decoupled, in-process communication.
https://github.com/henningtandberg/mando
command command-pattern mediator-design-pattern
Last synced: about 1 month ago
JSON representation
A super lightweight and free alternative to libraries that provide decoupled, in-process communication.
- Host: GitHub
- URL: https://github.com/henningtandberg/mando
- Owner: henningtandberg
- License: mit
- Created: 2025-08-29T20:27:35.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2026-04-26T09:26:39.000Z (about 1 month ago)
- Last Synced: 2026-04-26T10:08:00.450Z (about 1 month ago)
- Topics: command, command-pattern, mediator-design-pattern
- Language: C#
- Homepage: https://www.nuget.org/packages/Mando
- Size: 2.17 MB
- Stars: 11
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.NuGet.md
- License: LICENSE
Awesome Lists containing this project
README
# Mando
A super lightweight and free alternative to libraries that provide
decoupled, in-process communication.

[](https://github.com/henningtandberg/Mando/actions/workflows/build-test.yml)




---
## Usage
You can use the package directly or fork this repo and create your own,
custom implementation.
## Installation
The easiest way to add Mando to your project via [NuGet](https://www.nuget.org/packages/Mando).
## Features
The features of this library are limited by design, so that the library will
be easier to extend if you decide to fork the repo and create a more custom
implementation. The core features are, and will always be:
### Single command, single handler.
```csharp
internal sealed MyCustomCommand : ICommand;
internal sealed MyCustomCommandHandler : ICommandHandler
{
public Task Execute(MyCustomCommand command)
{
// Your magic here!
}
}
```
### Single command, multiple handlers.
```csharp
internal sealed MyCustomCommand : ICommand;
internal sealed MyCustomCommandHandlerOne : ICommandHandler
{
public Task Execute(MyCustomCommand command)
{
// Your magic here!
}
}
internal sealed MyCustomCommandHandlerTwo : ICommandHandler
{
public Task Execute(MyCustomCommand command)
{
// And some other magic here!
}
}
```
### Multiple commands, single handler
```csharp
internal sealed MyCustomCommandOne : ICommand;
internal sealed MyCustomCommandTwo : ICommand;
internal sealed MyCustomCommandHandler :
ICommandHandler, ICommandHandler
{
public Task Execute(MyCustomCommandOne command)
{
// Your magic here!
}
public Task Execute(MyCustomCommandTwo command)
{
// Even more magic here!
}
}
```
### Dependency Injection
```csharp
services.AddMando(Assembly.GetExecutingAssembly()))
```
This registers
- `ICommandHandler` : All implementations are registered as Scoped
- `IDispatcher` as Scoped
### Usage
```csharp
internal sealed class Application(IDispatcher dispatcher) : IApplication
{
public Task RunAsync() => dispatcher.Dispatch(new DoSomethingCommand());
}
```
Checkout [Mando.Example](https://github.com/henningtandberg/Mando/tree/main/Mando/Mando.Example) for a working example.