Mando 0.3.0
dotnet add package Mando --version 0.3.0
NuGet\Install-Package Mando -Version 0.3.0
<PackageReference Include="Mando" Version="0.3.0" />
<PackageVersion Include="Mando" Version="0.3.0" />
<PackageReference Include="Mando" />
paket add Mando --version 0.3.0
#r "nuget: Mando, 0.3.0"
#:package Mando@0.3.0
#addin nuget:?package=Mando&version=0.3.0
#tool nuget:?package=Mando&version=0.3.0
Mando
A super lightweight and free alternative to libraries that provide decoupled, in-process communication.
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.
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.
internal sealed MyCustomCommand : ICommand;
internal sealed MyCustomCommandHandler : ICommandHandler<MyCustomCommand>
{
public Task Execute(MyCustomCommand command)
{
// Your magic here!
}
}
Single command, multiple handlers.
internal sealed MyCustomCommand : ICommand;
internal sealed MyCustomCommandHandlerOne : ICommandHandler<MyCustomCommand>
{
public Task Execute(MyCustomCommand command)
{
// Your magic here!
}
}
internal sealed MyCustomCommandHandlerTwo : ICommandHandler<MyCustomCommand>
{
public Task Execute(MyCustomCommand command)
{
// And some other magic here!
}
}
Multiple commands, single handler
internal sealed MyCustomCommandOne : ICommand;
internal sealed MyCustomCommandTwo : ICommand;
internal sealed MyCustomCommandHandler :
ICommandHandler<MyCustomCommandOne>, ICommandHandler<MyCustomCommandTwo>
{
public Task Execute(MyCustomCommandOne command)
{
// Your magic here!
}
public Task Execute(MyCustomCommandTwo command)
{
// Even more magic here!
}
}
Dependency Injection
services.AddMando(Assembly.GetExecutingAssembly()))
This registers
ICommandHandler<TCommand>: All implementations are registered as ScopedIDispatcheras Scoped
Usage
internal sealed class Application(IDispatcher dispatcher) : IApplication
{
public Task RunAsync() => dispatcher.Dispatch(new DoSomethingCommand());
}
Checkout Mando.Example for a working example.
| 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
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.