title: How to send a message over a SignalR connection from Web API controller?
body: <p>I see several examples such as <a href="http://www.asp.net/signalr/overview/getting-started/tutorial-getting-started-with-signalr" rel="nofollow">this</a> where the messages are sent from a hub using javascript. How can I send a message over this same connection from my c# code?</p>
  
  <p>Specifically, I hit a post method in my web api controller and I would like to send a message over the SignalR connection from this controller. Is this possible?</p>
  
  <pre><code>public class ChatHub : Hub
  {
      public void Send(string name, string message)
      {
          // Call the addNewMessageToPage method to update clients.
          Clients.All.addNewMessageToPage(name, message);
      }
  }
  </code></pre>
  
  <p>and then in my Web Api post method:</p>
  
  <pre><code>  ChatHub hub = new ChatHub();
    hub.Send("testName", "test message");
  </code></pre>
  
  <p>All the examples I have seen send these messages from the javascript. This is my first time using SignalR. Can I send a message from the web api controller like this?</p>
  
  <p>Thank you very much for your time. Please let me know if I am being unclear or if you need any more information from me.</p>