DSoftStudio Mediator

DSoftStudio.Mediator — Documentation

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.

Why DSoftStudio.Mediator?

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.


Getting Started

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.


Core Concepts

Learn the fundamental building blocks: how requests are dispatched to handlers, how notifications fan out, and how streams enable async enumeration.


Features

Advanced capabilities built on top of the core mediator. Add cross-cutting concerns, simplify handler authoring, and enable dynamic dispatch.


Integrations

Optional companion NuGet packages that plug into the pipeline with zero configuration overhead.


Architecture

Deep dive into the internal design. Understand how source generators build the dispatch pipeline at compile time and why every allocation is eliminated.


Advanced Usage

Patterns and advanced scenarios for production applications.


Reference


Architecture Decision Records (ADR)

Key design decisions behind the project, documented as lightweight ADRs for traceability.