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
You can easily use a hub by following this 2 step-
Instantiating by dependency injection like this-
public class ClassName
{
........
........
private IHubContext _hub;
public BulletinSenderController(IConnectionManager connectionManager)
{
_hub = connectionManager.GetHubContext();
........
........
}
............
............
}
2.Using the hub
object like this-
_hub.Clients.All.onBulletinSent(bulletinToSend);
More can be found here.
Example code can be found in this git repo.