示例#1
0
        public void Add(IHostedConnection hostedConnection)
        {
            if (connections.Any(x => x.Id == hostedConnection.Id))
            {
                throw new ConnectionAlreadyAddedException();
            }

            connections.Add(hostedConnection);
        }
示例#2
0
        public bool Remove(IHostedConnection hostedConnection)
        {
            if (connections.Contains(hostedConnection))
            {
                connections.Remove(hostedConnection);
                return true;
            }

            return false;
        }