Share via


IRoleStore<TRole>.FindByIdAsync(String, CancellationToken) 方法

定义

查找具有指定 ID 作为异步操作的角色。

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

参数

roleId
String

要查找的角色 ID。

cancellationToken
CancellationToken

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

返回

Task<TRole>

查找 Task<TResult> 的结果。

适用于