共用方式為


UserOnlyStore<TUser,TContext,TKey,TUserClaim,TUserLogin,TUserToken>.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

使用者的識別碼。

cancellationToken
CancellationToken

用於散佈應取消作業通知的 CancellationToken

傳回

Task<TUser>

如果使用者存在,則為 。

適用於