Created
October 1, 2012 18:18
Revisions
-
ChristianWeyer renamed this gist
Oct 1, 2012 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
ChristianWeyer created this gist
Oct 1, 2012 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ namespace WebApi.SignalR { /// <summary> /// Simple Web API & SignalR integration. /// No access to full hub, e.g. HubCallerContext. /// </summary> /// <typeparam name="THub"></typeparam> public abstract class HubApiController<THub> : ApiController where THub : IHub { private Lazy<IHubContext> hub = new Lazy<IHubContext>( () => GlobalHost.ConnectionManager.GetHubContext<THub>() ); protected string ConnectionId { get { var connectionId = new FormDataCollection(Request.RequestUri).Get("connectionId"); return connectionId; } } protected IHubContext Hub { get { return hub.Value; } } } }