Share via


UserStore<TUser,TRole,TContext,TKey,TUserClaim,TUserRole,TUserLogin,TUserToken,TRoleClaim>.FindByIdAsync Méthode

Définition

Recherche et retourne un utilisateur, le cas échéant, qui a le spécifié userId.

public virtual System.Threading.Tasks.Task<TUser> FindByIdAsync (string userId, System.Threading.CancellationToken cancellationToken = default);
public override System.Threading.Tasks.Task<TUser> FindByIdAsync (string userId, System.Threading.CancellationToken cancellationToken = default);
public override System.Threading.Tasks.Task<TUser?> FindByIdAsync (string userId, System.Threading.CancellationToken cancellationToken = default);
abstract member FindByIdAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'User (requires 'User :> Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUser<'Key, 'UserClaim, 'UserRole, 'UserLogin>)>
override this.FindByIdAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'User (requires 'User :> Microsoft.AspNetCore.Identity.EntityFrameworkCore.IdentityUser<'Key, 'UserClaim, 'UserRole, 'UserLogin>)>
override this.FindByIdAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'User (requires 'User :> Microsoft.AspNetCore.Identity.IdentityUser<'Key>)>
Public Overridable Function FindByIdAsync (userId As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of TUser)
Public Overrides Function FindByIdAsync (userId As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of TUser)

Paramètres

userId
String

ID d’utilisateur à rechercher.

cancellationToken
CancellationToken

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

Retours

Task<TUser>

Task qui représente l’opération asynchrone, contenant l’utilisateur correspondant au spécifié userId s’il existe.

Implémente

S’applique à