我有这个代码:
private static readonly Dictionary<string, ChatUser> _users = new Dictionary<string, ChatUser>(StringComparer.OrdinalIgnoreCase);
private static readonly Dictionary<string, ChatRoom> _rooms = new Dictionary<string, ChatRoom>(StringComparer.OrdinalIgnoreCase);
public IEnumerable<ChatUser> GetUsersInRoom(string room)
{
if (String.IsNullOrEmpty(room))
{
return Enumerable.Empty<ChatUser>();
}
var results = from name in _rooms[room].Users
select _users[name];
return results;
}
我如何找到不在提供房间的人?:-/