Ejemplo n.º 1
0
        public override async Task OnConnectedAsync()
        {
            if (Context?.User?.Identity?.Name != null)
            {
                var user = _userService.SearchUserByEmail(Context.User.Identity.Name).FirstOrDefault();
                if (user != null)
                {
                    _userConnectionService.SaveUserConnection(user.Id, Context.ConnectionId);
                    await this.GetChatRooms(user.Id);
                }
            }

            await this.CreateGroupsForCurrentRooms();


            await base.OnConnectedAsync();
        }