RoleStore<TRole,TContext,TKey,TUserRole,TRoleClaim>.GetRoleNameAsync 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
從存放區取得作為非同步作業的角色名稱。
public System.Threading.Tasks.Task<string> GetRoleNameAsync (TRole role, System.Threading.CancellationToken cancellationToken = default);
public virtual System.Threading.Tasks.Task<string> GetRoleNameAsync (TRole role, System.Threading.CancellationToken cancellationToken = default);
public virtual System.Threading.Tasks.Task<string?> GetRoleNameAsync (TRole role, System.Threading.CancellationToken cancellationToken = default);
abstract member GetRoleNameAsync : 'Role * System.Threading.CancellationToken -> System.Threading.Tasks.Task<string>
override this.GetRoleNameAsync : 'Role * System.Threading.CancellationToken -> System.Threading.Tasks.Task<string>
Public Function GetRoleNameAsync (role As TRole, Optional cancellationToken As CancellationToken = Nothing) As Task(Of String)
Public Overridable Function GetRoleNameAsync (role As TRole, Optional cancellationToken As CancellationToken = Nothing) As Task(Of String)
參數
- role
- TRole
應該傳回其名稱的角色。
- cancellationToken
- CancellationToken
用於散佈應取消作業通知的 CancellationToken。
傳回
包含角色名稱的 Task<TResult>。