Created
September 13, 2021 08:40
-
-
Save KangDroid/2b51445aea2e6d842da9e1122938d892 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 room = await database.ChatRooms | |
.Include(r => r.Participants) | |
.ThenInclude(p => p.Chatbot) | |
.FirstOrDefaultAsync(r => | |
r.Participants.Count(p => p.ChatbotId == botId || p.UserId == user.Id) == 2 && | |
r.Participants.Count == 2); | |
// '채팅방 참여자 정보'를 채팅방 정보에서 불러오기[ | |
// 해당 코드는 데이터베이스에서 이루어지는 코멘트가 아닌 LINQ 쿼리입니다!] | |
var botParticipant = room.Participants.SingleOrDefault(p => p.ChatbotId == botId); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment