RoleStore<TRole,TContext,TKey,TUserRole,TRoleClaim>.FindByNameAsync 方法

定义

查找具有指定规范化名称作为异步操作的角色。

public virtual System.Threading.Tasks.Task<TRole> FindByNameAsync (string normalizedName, System.Threading.CancellationToken cancellationToken = default);
public virtual System.Threading.Tasks.Task<TRole?> FindByNameAsync (string normalizedName, System.Threading.CancellationToken cancellationToken = default);
abstract member FindByNameAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Role (requires 'Role :> Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole<'Key, 'UserRole, 'RoleClaim>)>
override this.FindByNameAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Role (requires 'Role :> Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityRole<'Key, 'UserRole, 'RoleClaim>)>
abstract member FindByNameAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Role (requires 'Role :> Microsoft.AspNetCore.Identity.IdentityRole<'Key>)>
override this.FindByNameAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Role (requires 'Role :> Microsoft.AspNetCore.Identity.IdentityRole<'Key>)>
Public Overridable Function FindByNameAsync (normalizedName As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of TRole)

参数

normalizedName
String

要查找的规范化角色名称。

cancellationToken
CancellationToken

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

返回

Task<TRole>

查找 Task<TResult> 的结果。

实现

适用于