public void Add(ChatRoomUserData roomUserData) { _db.RoomUserData.Add(roomUserData); _db.SaveChanges(); }
public void Remove(ChatRoomUserData roomUserData) { _db.RoomUserData.Remove(roomUserData); _db.SaveChanges(); }
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; }
public void Remove(ChatRoomUserData roomUserData) { _roomUserData.Remove(roomUserData); }