UserStoreBase<TUser,TKey,TUserClaim,TUserLogin,TUserToken>.FindUserAsync 方法

定义

返回具有匹配 userId 的用户(如果存在)。

protected:
 abstract System::Threading::Tasks::Task<TUser> ^ FindUserAsync(TKey userId, System::Threading::CancellationToken cancellationToken);
protected abstract System.Threading.Tasks.Task<TUser> FindUserAsync (TKey userId, System.Threading.CancellationToken cancellationToken);
protected abstract System.Threading.Tasks.Task<TUser?> FindUserAsync (TKey userId, System.Threading.CancellationToken cancellationToken);
abstract member FindUserAsync : 'Key * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'User (requires 'User :> Microsoft.AspNetCore.Identity.IdentityUser<'Key>)>
Protected MustOverride Function FindUserAsync (userId As TKey, cancellationToken As CancellationToken) As Task(Of TUser)

参数

userId
TKey

用户的 ID。

cancellationToken
CancellationToken

CancellationToken,用于传播应取消操作的通知。

返回

Task<TUser>

用户(如果存在)。

适用于