TimeWarp.Mediator.Generators
15.0.0-beta.5
Prefix Reserved
See the version list below for details.
dotnet add package TimeWarp.Mediator.Generators --version 15.0.0-beta.5
NuGet\Install-Package TimeWarp.Mediator.Generators -Version 15.0.0-beta.5
<PackageReference Include="TimeWarp.Mediator.Generators" Version="15.0.0-beta.5"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="TimeWarp.Mediator.Generators" Version="15.0.0-beta.5" />
<PackageReference Include="TimeWarp.Mediator.Generators"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add TimeWarp.Mediator.Generators --version 15.0.0-beta.5
#r "nuget: TimeWarp.Mediator.Generators, 15.0.0-beta.5"
#:package TimeWarp.Mediator.Generators@15.0.0-beta.5
#addin nuget:?package=TimeWarp.Mediator.Generators&version=15.0.0-beta.5&prerelease
#tool nuget:?package=TimeWarp.Mediator.Generators&version=15.0.0-beta.5&prerelease
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.5
dotnet add package TimeWarp.Mediator.Generators --version 15.0.0-beta.5
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 and TWM012 ship inside TimeWarp.Mediator. This package reports TWM007, TWM008, TWM010, and TWM011, and in a generator host it also reports TWM001–TWM003. A GeneratedHandlerAttribute whose handler name is not a constant, or is not a type name, is TWM012 from this package. An attribute in another assembly is read from a constructor parameter named handlerTypeName. The missing-type half of TWM012, and a named type that is not an IRequestHandler, are reported by the analyzer after every generator has run.
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/IPublisherreturnValueTask. Behaviors takeMessageHandlerDelegate<TRequest, TResponse>and callnext(request, cancellationToken). TimeWarp.Mediatortargets net10.0 and net11.0. The generator itself is netstandard2.0 because Roslyn loads it. The packages need a .NET SDK whose compiler is at least the Roslyn version they reference (11.0.100 or later; a 10.0.x band only if its compiler is at least that version); an older SDK reports CS8032/CS9057 and the generator emits nothing.- A missing or duplicate handler is a build error (TWM001, TWM002).
TimeWarpMediatorProfileis removed. Tooling reads[assembly: GeneratedMediator(typeof(Mediator))]andMediatorManifestversion 2.
Steps: Migration to 15.0.
Documentation
License
Released under The Unlicense. The notice and unlicense files ship 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 |