controller var HubContext = GlobalHost.ConnectionManager.GetHubContext<"ChatHub">(); //`ChatHub` can be your Hub Name
ChatHub HubObj= new ChatHub();
var RequiredId= HubObj.InvokeHubMethod(); hub public string InvokeHubMethod()
{
return "ConnectionID" //ConnectionID will the Id as string that you want outside the hub
}... 展开详请