Share via


RoleStore<TRole,TContext,TKey,TUserRole,TRoleClaim>.FindByNameAsync Méthode

Définition

Recherche le rôle qui a le nom normalisé spécifié en tant qu’opération asynchrone.

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)

Paramètres

normalizedName
String

Nom de rôle normalisé à rechercher.

cancellationToken
CancellationToken

CancellationToken utilisé pour propager les notifications indiquant que l’opération doit être annulée.

Retours

Task<TRole>

Task<TResult> résultat de la recherche vers le haut.

Implémente

S’applique à