using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using Microsoft.AspNetCore.Identity; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; namespace Hutopy.Infrastructure.Identity; public sealed class ApplicationUserManager( IUserStore store, IOptions optionsAccessor, IPasswordHasher passwordHasher, IEnumerable> userValidators, IEnumerable> passwordValidators, ILookupNormalizer keyNormalizer, IdentityErrorDescriber errors, IServiceProvider services, ILogger> logger) : UserManager( store, optionsAccessor, passwordHasher, userValidators, passwordValidators, keyNormalizer, errors, services, logger) { public async Task FindByCreatorAliasAsync(string creatorAlias, CancellationToken cancellationToken = default) { ArgumentException.ThrowIfNullOrEmpty(creatorAlias); ThrowIfDisposed(); var user = await Users.SingleOrDefaultAsync(u => EF.Functions.Like( creatorAlias, u.CreatorAlias), cancellationToken: cancellationToken); return user; } }