public void Configuration(IAppBuilder app)
        {
            var container = ObjectFactory.Container;
            var resolver  = new StructureMapSignalRDependencyResolver(container);

            ObjectFactory.Configure(x =>
            {
                x.For <Microsoft.AspNet.SignalR.StockTicker.IStockTicker>()
                .Singleton()
                .Use <Microsoft.AspNet.SignalR.StockTicker.StockTicker>();

                x.For <IHubConnectionContext>().ConditionallyUse(c =>
                                                                 c.If(t => t.ParentType.GetInterface(typeof(Microsoft.AspNet.SignalR.StockTicker.IStockTicker).Name) ==
                                                                      typeof(Microsoft.AspNet.SignalR.StockTicker.IStockTicker))
                                                                 .ThenIt.Is.ConstructedBy(
                                                                     () => resolver.Resolve <IConnectionManager>().GetHubContext <StockTickerHub>().Clients)
                                                                 );
            });

            var config = new HubConfiguration()
            {
                Resolver = resolver
            };

            //Set GlobalHost dependency resolver to ensure hubs utilize the same configuration (http://jerodkrone.com/signalr-2-0-dependency-injection-using-globalhost/).
            GlobalHost.DependencyResolver = resolver;

            //Required For iPad, without this the "Spinner" will spin infinitely (https://github.com/SignalR/SignalR/issues/1406).
            GlobalHost.Configuration.ConnectionTimeout = TimeSpan.FromSeconds(1);
            GlobalHost.Configuration.LongPollDelay     = TimeSpan.FromSeconds(5);

            Microsoft.AspNet.SignalR.StockTicker.Startup.ConfigureSignalR(app, config);
        }
        public void Configuration(IAppBuilder app)
        {
            var container = ObjectFactory.Container;
            var resolver = new StructureMapSignalRDependencyResolver(container);

            ObjectFactory.Configure(x =>
            {

                x.For<Microsoft.AspNet.SignalR.StockTicker.IStockTicker>()
                    .Singleton()
                    .Use<Microsoft.AspNet.SignalR.StockTicker.StockTicker>();

                x.For<IHubConnectionContext>().ConditionallyUse(c =>
                    c.If(t => t.ParentType.GetInterface(typeof(Microsoft.AspNet.SignalR.StockTicker.IStockTicker).Name) ==
                        typeof(Microsoft.AspNet.SignalR.StockTicker.IStockTicker))
                        .ThenIt.Is.ConstructedBy(
                            () => resolver.Resolve<IConnectionManager>().GetHubContext<StockTickerHub>().Clients)
                    );
            });

            var config = new HubConfiguration()
            {
                Resolver = resolver
            };

            //Set GlobalHost dependency resolver to ensure hubs utilize the same configuration (http://jerodkrone.com/signalr-2-0-dependency-injection-using-globalhost/).
            GlobalHost.DependencyResolver = resolver;

            //Required For iPad, without this the "Spinner" will spin infinitely (https://github.com/SignalR/SignalR/issues/1406).
            GlobalHost.Configuration.ConnectionTimeout = TimeSpan.FromSeconds(1);
            GlobalHost.Configuration.LongPollDelay = TimeSpan.FromSeconds(5);

            Microsoft.AspNet.SignalR.StockTicker.Startup.ConfigureSignalR(app, config);
        }