Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #5
0
 /// <summary>
 /// Deletes the specified request.
 /// </summary>
 /// <param name="request">The request.</param>
 public Task Delete(DeleteUser request)
 {
     return(DeleteAsync(request));
 }
Пример #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);
        }
Пример #7
0
 public Task DeleteAsync(DeleteUser request)
 {
     _userManager.DeleteUser(request.Id);
     _sessionMananger.RevokeUserTokens(request.Id, null);
     return(Task.CompletedTask);
 }