I\'ve set up a SignalR hub to communicate between the server and client. The hub server side code is stored in a class called Hooking.cs. What I want is to be able to call a
This has changed in .NET Core 2, now you can use dependency injection like this:
private readonly IHubContext _hubContext;
public MyController(MyHub,IMyHubInterface hubContext)
{
_hubContext = hubContext;
}
public bool SendViaSignalR()
{
_hubContext.Clients.All.MyClientSideSignalRMethod(new MyModel());
return true;
}