Quick Start

dotnet add package Mediatron

services.AddMediatron(
    Assembly.GetExecutingAssembly()
);

var mediator =
    serviceProvider.GetRequiredService<IMediator>();


int newId =
    await mediator.SendAsync<CreateProductCommand, int>(
        command
    );


await mediator.SendAsync(
    new DeleteProductCommand(newId)
);

Notifications

await mediator.PublishAsync(
    new ProductCreatedNotification(productId)
);