Created
September 13, 2021 08:51
-
-
Save KangDroid/2e92a8f9e5ecc91c36690ba45690fe1f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 채팅방 정보를 가져오기 | |
var roomId = await database.ChatRoomParticipants | |
.Where(p => p.ChatbotId == bot.Id || p.UserId == user.Id) | |
.GroupBy(p => p.RoomId) | |
.Where(g => g.Count() == 2) | |
.Select(g => g.Key) | |
.FirstOrDefaultAsync() ?? await CreateAndGetRoomId(bot, user, database); | |
// 봇이 참여하고 있는 '채팅방 참여자 정보' 가져오기 | |
var chatroomParticipantId = await database.ChatRoomParticipants | |
.Where(p => p.RoomId == roomId && p.ChatbotId == bot.Id) | |
.Select(p => p.Id) | |
.SingleOrDefaultAsync(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment