共用方式為


UserStoreBase<TUser,TRole,TKey,TUserClaim,TUserRole,TUserLogin,TUserToken,TRoleClaim>.FindRoleAsync 方法

定義

如果角色存在,則傳回具有正規化名稱的角色。

protected:
 abstract System::Threading::Tasks::Task<TRole> ^ FindRoleAsync(System::String ^ normalizedRoleName, System::Threading::CancellationToken cancellationToken);
protected abstract System.Threading.Tasks.Task<TRole> FindRoleAsync (string normalizedRoleName, System.Threading.CancellationToken cancellationToken);
protected abstract System.Threading.Tasks.Task<TRole?> FindRoleAsync (string normalizedRoleName, System.Threading.CancellationToken cancellationToken);
abstract member FindRoleAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Role (requires 'Role :> Microsoft.AspNetCore.Identity.IdentityRole<'Key>)>
Protected MustOverride Function FindRoleAsync (normalizedRoleName As String, cancellationToken As CancellationToken) As Task(Of TRole)

參數

normalizedRoleName
String

正規化角色名稱。

cancellationToken
CancellationToken

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

傳回

Task<TRole>

如果角色存在,則為 。

適用於