public static async Task xSetPasswordHashAsync <TKey>(this IIdentityUserWithPassword <TKey> user, string passwordHash, CancellationToken cancellationToken = default) where TKey : IEquatable <TKey> { cancellationToken.ThrowIfCancellationRequestedOrUserNull(user); await Task.FromResult(user.PasswordHash = passwordHash ?? throw new ArgumentNullException(nameof(passwordHash))); }
public static async Task <bool> xHasPasswordAsync <TKey>(this IIdentityUserWithPassword <TKey> user, CancellationToken cancellationToken = default) where TKey : IEquatable <TKey> { cancellationToken.ThrowIfCancellationRequestedOrUserNull(user); return(await Task.FromResult(user.PasswordHash != null)); }