title: Access SignalR Hub without Constructor Injection
body: <p>With AspNetCore.SignalR (1.0.0 preview1-final) and AspNetCore.All (2.0.6), how can I invoke a method on a hub in server code that is not directly in a Controller and is in a class that cannot be made via Dependency Injection?</p>
  
  <p>Most examples assume the server code is in a Controller and should 'ask' for the hub via an injectable parameter in a class that will created by DI.</p>
  
  <p>I want to be able to call the hub's method from server code at any time, in code that is not injected.  The old SignalR had a GlobalHost that enabled this approach. Basically, I need the hub to be a global singleton.</p>
  
  <p>Now, everything seems to be dependent on using Dependency Injection, which is introducing a dependency that I don't want! </p>
  
  <p>I've seen this request voiced in a number of places, but haven't found a working solution.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>To be more clear, all I need is to be able to later access the hubs that I've registered in the <code>Configure</code> routine of the <code>Startup</code> class:</p>
  
  <pre><code>app.UseSignalR(routes =&gt;
          {
              routes.MapHub&lt;PublicHubCore&gt;("/public");
              routes.MapHub&lt;AnalyzeHubCore&gt;("/analyze");
              routes.MapHub&lt;ImportHubCore&gt;("/import");
              routes.MapHub&lt;MainHubCore&gt;("/main");
              routes.MapHub&lt;FrontDeskHubCore&gt;("/frontdesk");
              routes.MapHub&lt;RollCallHubCore&gt;("/rollcall");
              // etc.
              // etc.
          }); 
  </code></pre>
  
  <p>If I register them like this:</p>
  
  <pre><code> services.AddSingleton&lt;IPublicHub, PublicHubCore&gt;();
  </code></pre>
  
  <p>it doesn't work, since I get back an uninitiated Hub.</p>