title: SignalR: Managing OnDisconnect() with multiple hubs
body: <p>I have a SignalR application which manages users and connections, User / Room, with a database.  I followed the following article (under <strong>Permanent, external storage</strong> -> <strong>Database</strong>)</p>
  
  <p><a href="http://www.asp.net/signalr/overview/guide-to-the-api/mapping-users-to-connections" rel="nofollow">http://www.asp.net/signalr/overview/guide-to-the-api/mapping-users-to-connections</a></p>
  
  <p>As someone logs in, I insert their entry into a Room table, and remove it as they leave.</p>
  
  <p>I now have two hubs, "Chat" and "Game".  </p>
  
  <p>Lets say for example UserA into both Chat and Game hub.  I create 2 entries into both a Chat table and Game table.  However, if UserA does a 'non-graceful' close of a single hub (ie. close tab), I am not able to pick which room/hub UserA disconnected from. (OnDisconnect does not allow me to capture these details).  This forces me to remove all occurrences of UserA across all tables he is found in on my database</p>
  
  <p>Now how is it possible for me to know which hub UserA exited from so that I may only remove his entry for that particular room. (e.g. UserA is in both <strong>Game Room</strong> and <strong>Chat Room</strong>.  He closes the <strong>Game Room</strong> window.  Application needs to only remove his entry from <strong>Game Room</strong> table.)</p>
  
  <p>Any input, suggestions is much appreciated.</p>