Пример #1
0
 /// <summary>
 /// Register a subscription
 /// </summary>
 /// <param name="connectionId">Hub Connection Id</param>
 /// <param name="key">key to identify the subscrition</param>
 /// <param name="subscription">IDisposable subscription instance</param>
 public void Add(string connectionId, string key, IDisposable subscription)
 {
     if (_store[connectionId]?.ContainsKey(key) ?? false)
     {
         DisposeAndRemove(connectionId, key);
     }
     if (!_store.ContainsKey(connectionId))
     {
         _store[connectionId] = new NullPropagatingDictionary <string, IDisposable>();
     }
     _store[connectionId][key] = subscription;
 }
Пример #2
0
 public HubSubscriptionManager()
 {
     _store = new NullPropagatingDictionary <string, NullPropagatingDictionary <string, IDisposable> >();
 }