Ejemplo n.º 1
0
        public void Configuration(IAppBuilder app)
        {
            var kernel = new StandardKernel();
            kernel.Bind<IClockService>().To<ClockService>()
                  .InSingletonScope();

            var resolver = new NinjectDependencyResolver(kernel);

            // This is kind gross but we'll improve it in the future
            kernel.Bind<IHubContext>()
                  .ToConstant(resolver.Resolve<IConnectionManager>()
                                      .GetHubContext<Clock>())
                  .WhenInjectedInto<ClockService>();

            // For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=316888

            app.MapSignalR(new HubConfiguration
            {
                Resolver = resolver
            });
        }