Beispiel #1
0
 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)));
 }
Beispiel #2
0
 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));
 }