UserStore<TUser,TRole,TContext,TKey,TUserClaim,TUserRole,TUserLogin,TUserToken,TRoleClaim>.FindUserAsync 方法

定义

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

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

参数

userId
TKey

用户的 ID。

cancellationToken
CancellationToken

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

返回

Task<TUser>

用户(如果存在)。

适用于