RoleStoreBase<TRole,TKey,TUserRole,TRoleClaim>.GetRoleNameAsync 方法

定义

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

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 Overridable Function GetRoleNameAsync (role As TRole, Optional cancellationToken As CancellationToken = Nothing) As Task(Of String)

参数

role
TRole

应返回其名称的角色。

cancellationToken
CancellationToken

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

返回

包含角色名称的 Task<TResult>

实现

适用于