public static ChatRoomClient Create(int id, string name = null, params ChatClient[] clients) { ChatRoomClient result = new ChatRoomClient(id, name); result.Clients.AddRange(clients); return(result); }
public void Add(ChatRoomClient client) { if (IsExist(client.Id)) { throw new ArgumentException(nameof(client.Id)); } mRooms.Add(client.Id, client); }