public void Add(ChatRoomUserData roomUserData)
 {
     _db.RoomUserData.Add(roomUserData);
     _db.SaveChanges();
 }
 public void Remove(ChatRoomUserData roomUserData)
 {
     _db.RoomUserData.Remove(roomUserData);
     _db.SaveChanges();
 }
Exemple #3
0
 public void Add(ChatRoomUserData roomUserData)
 {
     _roomUserData.Add(roomUserData);
 }
        public ChatRoomUserData GetRoomUserData(ChatUser user, ChatRoom room)
        {
            var roomUserData = _db.RoomUserData.FirstOrDefault(d => d.UserKey == user.Key && d.RoomKey == room.Key);

            if (roomUserData == null)
            {
                roomUserData = new ChatRoomUserData
                {
                    User = user,
                    Room = room,

                    IsMuted = false
                };

                Add(roomUserData);
            }

            return roomUserData;
        }
Exemple #5
0
 public void Remove(ChatRoomUserData roomUserData)
 {
     _roomUserData.Remove(roomUserData);
 }