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

定义

返回 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

用户的 ID。

roleId
TKey

角色的 ID。

cancellationToken
CancellationToken

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

返回

Task<TUserRole>

用户角色(如果存在)。

适用于