public async Task <IdentityResult> DeleteUserAsync(string distinguishedName) { try { _ldapService.DeleteUser(distinguishedName); } catch (Exception e) { return(await Task.FromResult(IdentityResult.Failed(new IdentityError() { Code = "LdapUserDeleteFailed", Description = e.Message ?? "The user could not be deleted." }))); } return(await Task.FromResult(IdentityResult.Success)); }