HelixBus.MessageBus.SourceGenerator
1.2.0
dotnet add package HelixBus.MessageBus.SourceGenerator --version 1.2.0
NuGet\Install-Package HelixBus.MessageBus.SourceGenerator -Version 1.2.0
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="HelixBus.MessageBus.SourceGenerator" Version="1.2.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HelixBus.MessageBus.SourceGenerator" Version="1.2.0" />
<PackageReference Include="HelixBus.MessageBus.SourceGenerator" />
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 HelixBus.MessageBus.SourceGenerator --version 1.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: HelixBus.MessageBus.SourceGenerator, 1.2.0"
#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 HelixBus.MessageBus.SourceGenerator@1.2.0
#: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=HelixBus.MessageBus.SourceGenerator&version=1.2.0
#tool nuget:?package=HelixBus.MessageBus.SourceGenerator&version=1.2.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
HelixBus.MessageBus.SourceGenerator
C# incremental source generator for HelixBus.
Generates strongly-typed handler mappings and avoids reflection at runtime.
🚀 Features
- Discover handlers at compile time
- Generate fast jump-table dispatchers
- Compatible with
[MediatorHandler]attribute - Fully incremental for performance
📦 Installation
dotnet add package HelixBus.MessageBus.SourceGenerator
🛠 Usage Example
Add attribute to handlers
[MessengerHandler]
public class GetUserQueryHandler : IRequestHandler<GetUserQuery, UserDto>
{
public Task<UserDto> Handle(GetUserQuery request, CancellationToken cancellationToken)
=> Task.FromResult(new UserDto(request.Id, "John Doe"));
}
Build your project
The generator will create strongly-typed mediator maps automatically. No runtime reflection required.
Benefits
- Faster dispatch at runtime
- Compile-time safety
- Clean architecture-friendly
💡 Best Practices
- Always use
[MediatorHandler]attribute on request/notification handlers - Combine with
HelixBus.MessageBus.DependencyInjectionfor automatic registration - Keep behaviors generic and reusable for pipeline processing
📄 License
MIT License. See LICENSE file.
There are no supported framework assets in this package.
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Microsoft.Extensions.DependencyInjection (>= 10.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.