title: What would the Autofac equivalent to this Ninject code be?
body: <p>On the following page: <a href="http://www.asp.net/signalr/overview/signalr-20/extensibility/dependency-injection" rel="noreferrer">http://www.asp.net/signalr/overview/signalr-20/extensibility/dependency-injection</a></p>
  
  <p>Near the bottom (just below the text "RegisterHubs.Start") there is a piece of Ninject code that I am trying to reproduce using Autofac.  </p>
  
  <p>So far I have succeeded in giving myself a headache, but not much else.  I have scoured the Autofac wiki, and the web for some help.  Though, I am sure I probably missed some tidbit of information.</p>
  
  <p><strong>Update</strong>: Here is the relevant Ninject code on the page. </p>
  
  <pre><code>public static class RegisterHubs
  {
      public static void Start()
      {
          var kernel = new StandardKernel();
          var resolver = new NinjectSignalRDependencyResolver(kernel);
  
          kernel.Bind&lt;IStockTicker&gt;()
              .To&lt;Microsoft.AspNet.SignalR.StockTicker.StockTicker&gt;()
              .InSingletonScope();
  
          kernel.Bind&lt;IHubConnectionContext&gt;().ToMethod(context =&gt;
                  resolver.Resolve&lt;IConnectionManager&gt;().
                      GetHubContext&lt;StockTickerHub&gt;().Clients
              ).WhenInjectedInto&lt;IStockTicker&gt;();
  
          var config = new HubConfiguration()
          {
              Resolver = resolver
          };
  
          App.MapSignalR(config);
      }
  }
  </code></pre>
  
  <p><strong>Update 2</strong>: Thought I would also add the objects trying to be composed.</p>
  
  <pre><code>public class StockTickerHub : Hub
  {
      private readonly IStockTicker _stockTicker;
  
      public StockTickerHub(IStockTicker stockTicker) { }
  }
  
  public class StockTicker
  {
      public StockTicker(IHubConnectionContext clients) { }
  }
  </code></pre>