Skip to content

SignalRHubRegistrationPlugin

NexusLabs.Needlr.SignalR

NexusLabs.Needlr.SignalR

SignalRHubRegistrationPlugin Class

Plugin that registers SignalR hubs discovered via IHubRegistrationPlugin implementations.

public sealed class SignalRHubRegistrationPlugin : NexusLabs.Needlr.AspNet.IWebApplicationPlugin

Inheritance System.Object 🡒 SignalRHubRegistrationPlugin

Implements NexusLabs.Needlr.AspNet.IWebApplicationPlugin

Remarks

This plugin uses reflection to invoke MapHub() at runtime because the SignalR API does not provide a non-generic overload.

For AOT/trimmed applications, use the source-generated approach instead:

var app = builder.Build();
app.MapGeneratedHubs(); // Generated at compile-time, no reflection

This plugin is marked with NexusLabs.Needlr.DoNotAutoRegisterAttribute to prevent automatic registration in source-gen scenarios. To use this reflection-based approach, explicitly register the plugin or call UseSignalRHubsWithReflection(this WebApplication, IPluginFactory, IEnumerable<Assembly>).