TurboMediator
Getting Started

Installation

How to install TurboMediator and its optional packages

Requirements

  • .NET 8.0+ (or .NET Standard 2.0 for the abstractions)
  • C# 11+ (for source generator support)

Core Packages

Every TurboMediator project requires these two packages:

Terminal
dotnet add package TurboMediator.Abstractions
dotnet add package TurboMediator.SourceGenerator

The Abstractions package contains all core interfaces (IRequest, ICommand, IQuery, INotification, handlers, pipeline behaviors, etc.).

The SourceGenerator package contains the Roslyn incremental source generator that produces the Mediator implementation class at compile time.

Optional Packages

Install only the packages you need. Each package is independent and adds specific pipeline behaviors:

Validation
dotnet add package TurboMediator.FluentValidation
Resilience (Retry, Circuit Breaker, Timeout, Fallback, Hedging)
dotnet add package TurboMediator.Resilience
Result Pattern (Functional Error Handling)
dotnet add package TurboMediator.Result
Observability (Telemetry, Metrics, Correlation, Logging, Health Checks)
dotnet add package TurboMediator.Observability
Caching (In-Memory, Custom Providers)
dotnet add package TurboMediator.Caching
Caching - Redis Provider
dotnet add package TurboMediator.Caching.Redis
Validation (Built-in Lightweight Validator)
dotnet add package TurboMediator.Validation
Enterprise (Authorization, Multi-Tenancy, Deduplication)
dotnet add package TurboMediator.Enterprise
Scheduling (Cron Jobs, Recurring Jobs)
dotnet add package TurboMediator.Scheduling
dotnet add package TurboMediator.Scheduling.EntityFramework
Rate Limiting & Bulkhead
dotnet add package TurboMediator.RateLimiting
Persistence (Transactions, Outbox, Audit)
dotnet add package TurboMediator.Persistence
dotnet add package TurboMediator.Persistence.EF
Saga
dotnet add package TurboMediator.Saga
dotnet add package TurboMediator.Saga.EntityFramework
Feature Flags
dotnet add package TurboMediator.FeatureFlags
dotnet add package TurboMediator.FeatureFlags.FeatureManagement
Batching
dotnet add package TurboMediator.Batching
Testing
dotnet add package TurboMediator.Testing
CLI Tool (global)
dotnet tool install --global TurboMediator.Cli

Project Setup

After installing the packages, register TurboMediator in your DI container:

Program.cs
using Microsoft.Extensions.DependencyInjection;

var builder = WebApplication.CreateBuilder(args);

// Basic registration - auto-discovers all handlers
builder.Services.AddTurboMediator();

// Or with configuration
builder.Services.AddTurboMediator(mediator =>
{
    mediator
        .WithSequentialNotifications();
});

var app = builder.Build();

The source generator automatically generates the AddTurboMediator() extension method with all discovered handler registrations.

On this page