Near-Direct Call Performance
Zero runtime reflection with source generators and C# interceptors for blazing fast execution.
Convention-based mediator powered by source generators and interceptors
Create a simple handler by following naming conventions:
public record Ping(string Text);
public static class PingHandler
{
public static string Handle(Ping msg) => $"Pong: {msg.Text}";
}
Register the mediator and use it:
// Program.cs
services.AddMediator();
// Usage
var reply = await mediator.InvokeAsync<string>(new Ping("Hello"));
// Output: "Pong: Hello"