public override Task RemoveLoginAsync(TUser user, string loginProvider, string providerKey, CancellationToken cancellationToken = default)
 {
     cancellationToken.ThrowIfCancellationRequested();
     ThrowIfDisposed();
     try
     {
         var uliContainer = UserLoginInfoContainer.Create(loginProvider, providerKey);
         identityDocumentStore.IdentitySession(s => s.Delete(uliContainer.id));
         return(Task.CompletedTask);
     }
     catch (Exception e)
     {
         logger.LogError(e, $"error AddClaimsAsync user:{user} ");
         throw;
     }
 }
        public override async Task AddLoginAsync(TUser user, UserLoginInfo login, CancellationToken cancellationToken = default)
        {//UserLoginInfoContainer
            cancellationToken.ThrowIfCancellationRequested();
            ThrowIfDisposed();
            try
            {
                var uliContainers = new UserLoginInfoContainer
                {
                    id      = login.GetId(),
                    Payload = login,
                    Refs    = new[] { user.Id },
                };

                await EnsureUserLoginInfoContainer(uliContainers, cancellationToken);
            }
            catch (Exception e)
            {
                logger.LogError(e, $"error AddClaimsAsync user:{user} ");
                throw;
            }
        }
        internal async Task <UserLoginInfoContainer> EnsureUserLoginInfoContainer(UserLoginInfoContainer uliContainer, CancellationToken cancellationToken = default)
        {
            cancellationToken.ThrowIfCancellationRequested();
            ThrowIfDisposed();
            try
            {
                var enureIdExist = uliContainer.Payload.GetId();
                var ucc          = await identityDocumentStore.IdentitySession <UserLoginInfoContainer>(async session => await session.LoadAsync <UserLoginInfoContainer>(enureIdExist));

                if (ucc == null)
                {
                    await identityDocumentStore.IdentitySession(async session => await session.StoreAsync(uliContainer, enureIdExist, cancellationToken));

                    return(await EnsureUserLoginInfoContainer(uliContainer, cancellationToken));
                }
                return(ucc);
            }
            catch (Exception e)
            {
                logger.LogError(e, $"error EnsureUserLoginInfoContainer   ");
                throw;
            }
        }