title: Send messages from server to client via SignalR in .NET Core
body: <p>I want to send messages from the server (from a class, not a controller) via the SignalR Hub. </p>
  
  <p>The hub works for messages originating from the client but not for messages from the server. </p>
  
  <p>I've tried multiple methods of which non seem to work. For example, I tried retrieving the hub context using:
  <code>GlobalHost.ConnectionManager.GetHubContext&lt;MyHub&gt;()</code>
  with no success.</p>
  
  <p>What is the best and up-to-date method of doing this in .NET Core?</p>
  
  <p><strong>Temporary Solution:</strong></p>
  
  <p>Having a websocket client inside the host api. Then making it connect to itself. This is not an ideal solution but works as a temporary fix. </p>