public async Task AddToChat(string chatId) { try { var userInfo = await _distributedCache.GetObjectAsync <User>(Context.ConnectionId); var userChatInfo = _hubService.FindUserInChat(userInfo.AppId, chatId, userInfo.Id); if (userChatInfo != null) { await Groups.AddToGroupAsync(Context.ConnectionId, chatId); } } catch { } }