Table of Contents

Class EfCoreExternalLoginAccountResolver

Namespace
ProjectTemplate.Infrastructure.Data.ExternalLogins
Assembly
ProjectTemplate.Infrastructure.dll

EF Core implementation of IExternalLoginAccountResolver.

public sealed class EfCoreExternalLoginAccountResolver : IExternalLoginAccountResolver
Inheritance
EfCoreExternalLoginAccountResolver
Implements
Inherited Members

Constructors

EfCoreExternalLoginAccountResolver(ApplicationDbContext)

EF Core implementation of IExternalLoginAccountResolver.

public EfCoreExternalLoginAccountResolver(ApplicationDbContext dbContext)

Parameters

dbContext ApplicationDbContext

Methods

FindByLocalUserIdAsync(Guid, CancellationToken)

Finds all external login accounts associated with a specific local user ID.

public Task<IReadOnlyList<ExternalLoginAccount>> FindByLocalUserIdAsync(Guid localUserId, CancellationToken cancellationToken = default)

Parameters

localUserId Guid

Local user ID (the unique identifier for the user in the local system). If this value is Guid.Empty, an empty list will be returned.

cancellationToken CancellationToken

Cancellation token to cancel the operation if needed.

Returns

Task<IReadOnlyList<ExternalLoginAccount>>

Returns a list of ExternalLoginAccount instances associated with the specified local user ID. If no accounts are found, an empty list is returned.

FindByProviderUserIdAsync(string, string, CancellationToken)

Finds an external login account by the provider name and provider user ID.

public Task<ExternalLoginAccount?> FindByProviderUserIdAsync(string providerName, string providerUserId, CancellationToken cancellationToken = default)

Parameters

providerName string

Provider name. This value is matched case-insensitively after trimming and Unicode normalization.

providerUserId string

Provider user ID. This value is trimmed and Unicode-normalized, but remains case-sensitive.

cancellationToken CancellationToken

Cancellation token to cancel the operation if needed.

Returns

Task<ExternalLoginAccount>

Returns the matching ExternalLoginAccount if found; otherwise, returns null.