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

定义

返回具有规范化名称的角色(如果存在)。

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

参数

normalizedRoleName
String

规范化的角色名称。

cancellationToken
CancellationToken

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

返回

Task<TRole>

角色(如果存在)。

适用于