/// <inheritdoc/> protected override async Task <TUser> FindUserAsync(TKey userId, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); ThrowIfDisposed(); var user = await UsersTable.FindByIdAsync(userId); return(user); }
/// <inheritdoc/> public override async Task <TUser> FindByIdAsync(string userId, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); ThrowIfDisposed(); var id = ConvertIdFromString(userId); var user = await UsersTable.FindByIdAsync(id); return(user); }
public Task <ApplicationUser> FindByIdAsync(string userId, CancellationToken cancellationToken = default(CancellationToken)) { cancellationToken.ThrowIfCancellationRequested(); var isValidGuid = Guid.TryParse(userId, out var userGuid); if (!isValidGuid) { return(Task.FromResult <ApplicationUser>(null)); } return(_usersTable.FindByIdAsync(userGuid)); }