title: Use Hub methods from controller?
body: <p>I am using SignalR 2 and I can not figure out how I can use my Hub methods e.g from inside a controller action.</p>
  
  <p>I know I can do the following:</p>
  
  <pre><code>var hub = GlobalHost.ConnectionManager.GetHubContext&lt;T&gt;();
  hub.Clients.All.clientSideMethod(param);
  </code></pre>
  
  <p>But that executes the method directly on the client side.</p>
  
  <p>What if I have business logic inside my server side <code>ClientSideMethod(param)</code> method I want to call from my controller the same way as when it is called from the client side?</p>
  
  <p>At the moment I use <code>public static void ClientSideMethod(param)</code> inside my hub and in that method I use the <code>IHubContext</code> from the <code>ConnectionManager</code>. </p>
  
  <p><strong>Is there no better was of doing this?</strong></p>
  
  <p>The following is not working (anymore in SignalR 2?):</p>
  
  <pre><code>var hubManager = new DefaultHubManager(GlobalHost.DependencyResolver);
  instance = hubManager.ResolveHub(typeof(T).Name) as T;
  instance.ClientSideMethod(param);
  </code></pre>
  
  <p>There I get a "Hub not created via Hub pipeline not supported" exception, when accessing the Clients.</p>