IRoleStore<TRole>.GetRoleNameAsync(TRole, CancellationToken) 方法

定义

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

public:
 System::Threading::Tasks::Task<System::String ^> ^ GetRoleNameAsync(TRole role, System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<string> GetRoleNameAsync (TRole role, System.Threading.CancellationToken cancellationToken);
public System.Threading.Tasks.Task<string?> GetRoleNameAsync (TRole role, System.Threading.CancellationToken cancellationToken);
abstract member GetRoleNameAsync : 'Role * System.Threading.CancellationToken -> System.Threading.Tasks.Task<string>
Public Function GetRoleNameAsync (role As TRole, cancellationToken As CancellationToken) As Task(Of String)

参数

role
TRole

应返回其名称的角色。

cancellationToken
CancellationToken

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

返回

包含角色名称的 Task<TResult>

适用于