Skip to content

Instantly share code, notes, and snippets.

@bitsprint
Created March 21, 2013 14:47
Show Gist options
  • Select an option

  • Save bitsprint/5213600 to your computer and use it in GitHub Desktop.

Select an option

Save bitsprint/5213600 to your computer and use it in GitHub Desktop.
ApiControllerWithHub.csx
public abstract class ApiControllerWithHub<THub> : ApiController where THub : IHub
{
Lazy<IHubContext> hub = new Lazy<IHubContext>(
() => GlobalHost.ConnectionManager.GetHubContext<THub>()
);
protected IHubContext Hub
{
get { return hub.Value; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment