Last active
August 29, 2015 13:57
-
-
Save lkaczanowski/9629111 to your computer and use it in GitHub Desktop.
ApiController with SignalR
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// taken from: https://github.com/bradwilson/ndc2012/tree/master/NdcDemo | |
public abstract class ApiControllerWithHub<THub> : ApiController | |
where THub : IHub | |
{ | |
private readonly 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