TimeWarp.Mediator.Generators 15.0.0-beta.2

Prefix Reserved
This is a prerelease version of TimeWarp.Mediator.Generators.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package TimeWarp.Mediator.Generators --version 15.0.0-beta.2
                    
NuGet\Install-Package TimeWarp.Mediator.Generators -Version 15.0.0-beta.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TimeWarp.Mediator.Generators" Version="15.0.0-beta.2">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TimeWarp.Mediator.Generators" Version="15.0.0-beta.2" />
                    
Directory.Packages.props
<PackageReference Include="TimeWarp.Mediator.Generators">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TimeWarp.Mediator.Generators --version 15.0.0-beta.2
                    
#r "nuget: TimeWarp.Mediator.Generators, 15.0.0-beta.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TimeWarp.Mediator.Generators@15.0.0-beta.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TimeWarp.Mediator.Generators&version=15.0.0-beta.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=TimeWarp.Mediator.Generators&version=15.0.0-beta.2&prerelease
                    
Install as a Cake Tool

TimeWarp.Mediator.Generators

Source generator for TimeWarp Mediator 15.0. It emits one internal mediator. Send returns the handler ValueTask. The host supplies IServiceProvider, and registered pipeline behaviors are woven. The path is trim and NativeAOT safe.

Install

dotnet add package TimeWarp.Mediator --version 15.0.0-beta.2
dotnet add package TimeWarp.Mediator.Generators --version 15.0.0-beta.2

Without --version, dotnet add package TimeWarp.Mediator resolves 14.0.0, the reflection runtime. Drop the flag when 15.0 is the stable package.

Generators does not bring TimeWarp.Mediator with it. Keep both on the same version. TWM001–TWM004 ship inside TimeWarp.Mediator. This package reports TWM007, TWM008, TWM010, and TWM011, and in a generator host it also reports TWM001–TWM003.

Example

using Microsoft.Extensions.DependencyInjection;
using TimeWarp.Mediator;
using TimeWarp.Mediator.Generated;

ServiceCollection services = new();
services.AddGeneratedMediator();
using ServiceProvider provider = services.BuildServiceProvider();
using IServiceScope scope = provider.CreateScope();
string reply = await scope.ServiceProvider.GetRequiredService<ISender>().Send(new Ping());

public sealed class Ping : IRequest<string> { }

public sealed class PingHandler : IRequestHandler<Ping, string>
{
  public ValueTask<string> Handle(Ping request, CancellationToken cancellationToken) =>
    ValueTask.FromResult("Pong");
}

The host that references this package is a graph member. A library opts in with [assembly: MediatorAssembly] and does not reference this package. Register a pipeline behavior with [assembly: MediatorBehavior(typeof(MyBehavior<,>))]. AddGeneratedMediator() lives in the generated namespace (TimeWarp.Mediator.Generated unless TimeWarpMediatorNamespace is set).

Migration

15.0 is a breaking release.

  • Handlers and ISender / IPublisher return ValueTask. Behaviors take MessageHandlerDelegate<TRequest, TResponse> and call next(request, cancellationToken).
  • TimeWarp.Mediator targets net10.0 and net11.0. The generator itself is netstandard2.0 because Roslyn loads it. The Roslyn floor is Microsoft.CodeAnalysis.CSharp 5.0.0.
  • A missing or duplicate handler is a build error (TWM001, TWM002).
  • TimeWarpMediatorProfile is removed. Tooling reads [assembly: GeneratedMediator(typeof(Mediator))] and MediatorManifest version 2.

Steps: Migration to 15.0.

Documentation

License

Released under The Unlicense. The notice and unlicense files ship in this package.

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on TimeWarp.Mediator.Generators:

Package Downloads
TimeWarp.Nuru

Route-based CLI framework for .NET - batteries included with telemetry, REPL, and shell completion

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
15.0.0-beta.6 46 11/9/2026
15.0.0-beta.5 123 11/5/2026
15.0.0-beta.4 657 10/31/2026
15.0.0-beta.2 105 10/28/2026
15.0.0-beta.1 60 10/26/2026
14.0.0 2,435 10/13/2026
14.0.0-beta.5 281 10/13/2026
14.0.0-beta.4 1,248 9/27/2026
14.0.0-beta.3 78 9/25/2026
14.0.0-beta.2 71 9/25/2026
14.0.0-beta.1 287 9/2/2026