Beispiel #1
0
        public Task DeleteAsync(DeleteUser request)
        {
            var user = _userManager.GetUserById(request.Id);

            if (user == null)
            {
                throw new ResourceNotFoundException("User not found");
            }

            _sessionMananger.RevokeUserTokens(user.Id, null);
            _userManager.DeleteUser(user);
            return(Task.CompletedTask);
        }
Beispiel #2
0
        /// <summary>
        /// Deletes the specified request.
        /// </summary>
        /// <param name="request">The request.</param>
        public void Delete(DeleteUser request)
        {
            var user = _userManager.GetUserById(request.Id);

            if (user == null)
            {
                throw new ResourceNotFoundException("User not found");
            }

            var task = _userManager.DeleteUser(user);

            Task.WaitAll(task);
        }
Beispiel #3
0
        public async Task DeleteAsync(DeleteUser request)
        {
            var user = _userManager.GetUserById(request.Id);

            if (user == null)
            {
                throw new ResourceNotFoundException("User not found");
            }

            _sessionMananger.RevokeUserTokens(user.Id.ToString("N"), null);

            await _userManager.DeleteUser(user).ConfigureAwait(false);
        }
Beispiel #4
0
        /// <summary>
        /// Deletes the specified request.
        /// </summary>
        /// <param name="request">The request.</param>
        public void Delete(DeleteUser request)
        {
            var user = _userManager.GetUserById(request.Id);

            if (user == null)
            {
                throw new ResourceNotFoundException("User not found");
            }

            var revokeTask = _sessionMananger.RevokeUserTokens(user.Id.ToString("N"));

            Task.WaitAll(revokeTask);

            var task = _userManager.DeleteUser(user);

            Task.WaitAll(task);
        }
Beispiel #5
0
 /// <summary>
 /// Deletes the specified request.
 /// </summary>
 /// <param name="request">The request.</param>
 public Task Delete(DeleteUser request)
 {
     return(DeleteAsync(request));
 }
Beispiel #6
0
        /// <summary>
        /// Deletes the specified request.
        /// </summary>
        /// <param name="request">The request.</param>
        public void Delete(DeleteUser request)
        {
            var task = DeleteAsync(request);

            Task.WaitAll(task);
        }
Beispiel #7
0
 public Task DeleteAsync(DeleteUser request)
 {
     _userManager.DeleteUser(request.Id);
     _sessionMananger.RevokeUserTokens(request.Id, null);
     return(Task.CompletedTask);
 }