共用方式為


UserStoreBase<TUser,TRole,TKey,TUserClaim,TUserRole,TUserLogin,TUserToken,TRoleClaim>.FindUserRoleAsync 方法

定義

如果 userId 存在,則傳回 userId 和 roleId 的使用者角色。

protected:
 abstract System::Threading::Tasks::Task<TUserRole> ^ FindUserRoleAsync(TKey userId, TKey roleId, System::Threading::CancellationToken cancellationToken);
protected abstract System.Threading.Tasks.Task<TUserRole> FindUserRoleAsync (TKey userId, TKey roleId, System.Threading.CancellationToken cancellationToken);
protected abstract System.Threading.Tasks.Task<TUserRole?> FindUserRoleAsync (TKey userId, TKey roleId, System.Threading.CancellationToken cancellationToken);
abstract member FindUserRoleAsync : 'Key * 'Key * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'UserRole (requires 'UserRole :> Microsoft.AspNetCore.Identity.IdentityUserRole<'Key> and 'UserRole : (new : unit -> 'UserRole))>
Protected MustOverride Function FindUserRoleAsync (userId As TKey, roleId As TKey, cancellationToken As CancellationToken) As Task(Of TUserRole)

參數

userId
TKey

使用者的識別碼。

roleId
TKey

角色的識別碼。

cancellationToken
CancellationToken

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

傳回

Task<TUserRole>

如果使用者角色存在,則為 。

適用於