Exemplo n.º 1
0
        // this will start a new chat room if there is a saved room in the db
        public ChatRoom GetRoom(string name)
        {
            if (rooms.ContainsKey(name))
            {
                return(rooms[name]);
            }

            var saved = _roomDatabase.Load(name);

            if (saved == null)
            {
                throw new RoomNotFoundException("room not found: " + name);
            }
            var newRoom = new ChatRoom {
                Name = name
            };

            rooms[name] = newRoom;
            return(newRoom);
        }
Exemplo n.º 2
0
 public ActionResult <Room> Get(string id)
 {
     return(db.Load(id));
 }