Share via


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

Définition

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

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

Paramètres

id
String

ID de rôle à 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 à