public IHttpActionResult JoinPrivateRoom(int id)
        {
            var userId = this.provider.GetUserId();

            var user = this.data.Users.GetById(userId);
            var room = this.data.PrivateRooms.GetById(id);

            RoomsJoiningHistory log = new RoomsJoiningHistory()
            {
                JoinedOn = DateTime.Now,
                Room = room,
                User = user
            };

            if (room == null)
            {
                return this.BadRequest("Such room does not exist");
            }

            this.data.RoomsJoiningHistory.Add(log);
            this.data.SaveChanges();
            return this.Ok(room.Id);
        }
        public IHttpActionResult JoinRoom(int id)
        {
            var userId = this.provider.GetUserId();

            var user = this.data.Users.All()
                .FirstOrDefault(u => u.Id == userId);
            var room = this.data.PublicRooms.All()
                .FirstOrDefault(r => r.Id == id);

            RoomsJoiningHistory log = new RoomsJoiningHistory()
            {
                JoinedOn = DateTime.Now,
                Room = room,
                User = user
            };

            if (room == null)
            {
                return this.BadRequest("Such room does not exist");
            }

            room.Members.Add(user);
            this.data.RoomsJoiningHistory.Add(log);
            this.data.SaveChanges();
            return this.Ok("Room joined successfully");
        }