RoleStore<TRole,TContext,TKey,TUserRole,TRoleClaim>.GetRoleIdAsync 方法

定义

以异步操作的形式从存储中获取角色的 ID。

public System.Threading.Tasks.Task<string> GetRoleIdAsync (TRole role, System.Threading.CancellationToken cancellationToken = default);
public virtual System.Threading.Tasks.Task<string> GetRoleIdAsync (TRole role, System.Threading.CancellationToken cancellationToken = default);
abstract member GetRoleIdAsync : 'Role * System.Threading.CancellationToken -> System.Threading.Tasks.Task<string>
override this.GetRoleIdAsync : 'Role * System.Threading.CancellationToken -> System.Threading.Tasks.Task<string>
Public Function GetRoleIdAsync (role As TRole, Optional cancellationToken As CancellationToken = Nothing) As Task(Of String)
Public Overridable Function GetRoleIdAsync (role As TRole, Optional cancellationToken As CancellationToken = Nothing) As Task(Of String)

参数

role
TRole

应返回其 ID 的角色。

cancellationToken
CancellationToken

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

返回

一个 Task<TResult> 包含角色 ID 的 。

实现

适用于