示例#1
0
        public override async Task <IdentityResult> DeleteAsync(ApplicationUser <TKey> user, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();
            ThrowIfDisposed();
            user.ThrowIfNull(nameof(user));

            return(await UsersTable.DeleteAsync(user));
        }
示例#2
0
        public Task <IdentityResult> DeleteAsync(ApplicationUser user, CancellationToken cancellationToken)
        {
            if (user == null)
            {
                throw new ArgumentNullException(nameof(user), "Parameter user is not set to an instance of an object.");
            }

            return(_usersTable.DeleteAsync(user, cancellationToken));
        }
示例#3
0
        /// <inheritdoc/>
        public override async Task <IdentityResult> DeleteAsync(TUser user, CancellationToken cancellationToken)
        {
            cancellationToken.ThrowIfCancellationRequested();
            ThrowIfDisposed();
            user.ThrowIfNull(nameof(user));
            var deleted = await UsersTable.DeleteAsync(user.Id);

            return(deleted ? IdentityResult.Success : IdentityResult.Failed(new IdentityError
            {
                Code = string.Empty,
                Description = $"User '{user.UserName}' could not be deleted."
            }));
        }
示例#4
0
 public Task <IdentityResult> DeleteAsync(ApplicationUser user, CancellationToken cancellationToken = default)
 {
     cancellationToken.ThrowIfCancellationRequested();
     user.ThrowIfNull(nameof(user));
     return(_usersTable.DeleteAsync(user));
 }