我'm trying to call client methods outside the hub on SignalR, the link below shows how to do this in the old version, although i' m不确定如何在SignalR ASP.NET Core版本中执行此操作 . 我找到了对old post的引用,并使用了对Microsoft.AspNetCore.SignalR.Infrastructure.IConnectionManager的引用,尽管此命名空间似乎不再存在 . 一个例子会很棒吗?
旧版本:How to call client methods and manage groups from outside the Hub class
1 回答
你需要注入
IHubContext<THub>
然后应该能够调用方法 .