Can I inject a signalR hub (ChatHub derives from Hub) into a service by doing the following:
in Startup.cs:
services.AddSingleton<ChatHub>();
To inject in another service:
public AnotherClass(ChatHub chatHub)(....
... chatHub.CallMethod(...
Its working but it is a good idea? I always find the IHubContext for that purpose, but why should I use them?
IHubContext
. docs.microsoft.com/aspnet/core/signalr/… – Brennan