Skip to content

Instantly share code, notes, and snippets.

@riccardod
Created January 19, 2014 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save riccardod/5d3b2fe7552cccb8e31e to your computer and use it in GitHub Desktop.
Save riccardod/5d3b2fe7552cccb8e31e to your computer and use it in GitHub Desktop.
class SignalRStartup
{
public void Configuration(IAppBuilder app)
{
var kernel = K.CreateKernel();
var resolver = new NinjectSignalRDependencyResolver(kernel);
app.Map("/signalr", map =>
{
kernel.Bind<IOffloadService>().To<OffloadService>().InSingletonScope();
kernel.Bind<IHubConnectionContext>().ToMethod(context =>
resolver.Resolve<IConnectionManager>().
GetHubContext<OffloadHub>().Clients
).WhenInjectedInto<IOffloadService>();
var hubConfiguration = new HubConfiguration
{
Resolver = resolver,
EnableDetailedErrors = true,
};
map.RunSignalR(hubConfiguration);
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment