public void Update(T key, string nickName) { lock (_connections) { if (_connections.ContainsKey(key)) { _connections[key] = new UserConnectionInfo { ConnectionId = GetConnections(key).ConnectionId, NickName = nickName }; } } }
public void Add(T key, UserConnectionInfo userInfo) { lock (_connections) { if (!_connections.ContainsKey(key)) { _connections.Add(key, userInfo); } } userAdded?.Invoke(this, new AddMyUserEventArgs { Id = key as string }); }