public async override Task OnConnectedAsync() { IdentityUser user = await _um.GetUserAsync(Context.User); String cid = Context.ConnectionId; lock (_SRC) { _SRC.AddConnection(user.Id, cid, user.Email); } List <uint> temp = _cdb.GetUserChatsNames(user.Id); temp.ForEach(x => { Groups.AddToGroupAsync(cid, "cg_" + x.ToString()); }); //await Clients.All.SendAsync("UserAdded", user.Email); await base.OnConnectedAsync(); }