title: How can I set up SignalR Hub Dependency Injection in ASP.NET 5 (vNext)?
body: <p>Trying to do dependency injection into my SignalR Hub class using the SignalR-Server which is part of ASP.NET 5 (<a href="https://github.com/aspnet/SignalR-Server" rel="noreferrer">repo</a>). I tried to figure this out from the tutorial at <a href="http://www.asp.net/signalr/overview/advanced/dependency-injection" rel="noreferrer">this link</a> but I can't seem to identify how I can do this given that <code>GlobalHost</code> is no longer available. Here's what I'm trying to do:</p>
  
  <p><strong>Startup.cs</strong></p>
  
  <pre><code>public void ConfigureServices(IServiceCollection services)
  {
      services.AddSignalR();
      services.AddSingleton&lt;IState, State&gt;();
  }
  
  public void Configure(IApplicationBuilder app)
  {
      app.UseSignalR();
  }
  </code></pre>
  
  <p><strong>MyHub.cs</strong></p>
  
  <pre><code>public class MyHub : Hub
  {
      public IState State { get; set; }
  
      // SignalR accepts this parameterless ctor
      public MyHub()
      {
      }
  
      // SignalR won't use this because it has a parameter
      public MyHub(IState state)
      {
          State = state;
      }
  }
  </code></pre>
  
  <p>How can I get <a href="https://github.com/aspnet/SignalR-Server" rel="noreferrer">SignalR-Server</a> to use the <code>MyHub(IState state)</code> constructor injecting the required dependencies?</p>