public async Task <IConversation> JoinUserToConversation(IConversation conversation, long userId, string signalRConnectionId) { bool exists = await _conversationRepository.ConversationHasActiveUser(conversation.ConversationId, userId); if (!exists) { var activeUser = await _userSummaryRepository.GetById(userId); if (activeUser != null && !string.IsNullOrWhiteSpace(activeUser.DisplayName)) { _conversationRepository.JoinUserToConversation(conversation.ConversationId, userId, signalRConnectionId); conversation.UserJoined(activeUser); } } return(conversation); }