共用方式為


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

定義

以非同步作業的形式,從存放區取得角色的識別碼。

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

應該傳回其識別碼的角色。

cancellationToken
CancellationToken

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

傳回

Task<TResult>,包含角色的識別碼。

實作

適用於