A source-generated mediator for .NET that compiles your pipeline ahead of time — no reflection, no runtime composition, no hidden cost.
No surprises. No hidden cost. No runtime magic.
This documentation is organized to help you move from quick onboarding to deep architectural understanding.
Traditional mediator libraries discover handlers at runtime through reflection and
build their pipelines dynamically on every request. DSoftStudio.Mediator takes a
fundamentally different approach: a Roslyn source generator analyzes your code at
compile time, wires every handler, behavior, and processor into a strongly-typed
pipeline, and emits plain C# — no Activator.CreateInstance, no Expression.Compile,
no hidden allocations. The result is near-zero dispatch overhead, full
Native AOT and IL-trimming compatibility, and a pipeline you can step through
in the debugger just like any other method call.
Start here if you’re new to the library. Install the NuGet package, send your first request, and understand how handler registration order affects pipeline execution.
Learn the fundamental building blocks: how requests are dispatched to handlers, how notifications fan out, and how streams enable async enumeration.
IAsyncEnumerable<T> stream handlers.Advanced capabilities built on top of the core mediator. Add cross-cutting concerns, simplify handler authoring, and enable dynamic dispatch.
Send(object)) — Dispatch a request when its compile-time type is unknown.Optional companion NuGet packages that plug into the pipeline with zero configuration overhead.
HybridCache with attribute-driven invalidation.Deep dive into the internal design. Understand how source generators build the dispatch pipeline at compile time and why every allocation is eliminated.
Patterns and advanced scenarios for production applications.
Key design decisions behind the project, documented as lightweight ADRs for traceability.