Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Implements and reviews ASP.NET Core SignalR hubs, streaming, reconnection, transports, and real-time group broadcasting patterns.
95% 100%+5 ptsof test cases passed
Passed 22 of 22 test cases with the skill, and 21 of 22 without it.
3 of 3 safety checks passed
This reference provides detailed patterns for implementing SignalR hubs, streaming, groups, and connection management.
Separate hubs by domain feature rather than creating one monolithic hub:
// Good: Feature-focused hubs
app.MapHub<ChatHub>("/hubs/chat");
app.MapHub<NotificationHub>("/hubs/notifications");
app.MapHub<CollaborationHub>("/hubs/collaboration");
app.MapHub<PresenceHub>("/hubs/presence");
// Bad: One hub for everything
app.MapHub<ApplicationHub>("/hubs/app"); // Too broad
Keep hub methods thin and delegate to services:
public class OrderHub : Hub<IOrderClient>
{
private readonly IOrderService _orderService;
private readonly IValidator<PlaceOrderRequest> _validator;
private readonly ILogger<OrderHub> _logger;
public OrderHub(
IOrderService orderService,
IValidator<PlaceOrderRequest> validator,
ILogger<OrderHub> logger)
{
_orderService = orderService;
_validator = validator;
_logger = logger;
Next to this one in the catalogue, plus more from the same author.