Condividi tramite


UserStore<TUser,TRole,TContext,TKey,TUserClaim,TUserRole,TUserLogin,TUserToken,TRoleClaim>.FindByIdAsync Metodo

Definizione

Trova e restituisce un utente, se presente, che ha l'oggetto specificato 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)

Parametri

userId
String

ID utente da cercare.

cancellationToken
CancellationToken

Oggetto CancellationToken usato per propagare le notifiche di richiesta di annullamento dell'operazione.

Restituisce

Task<TUser>

Oggetto Task che rappresenta l'operazione asincrona contenente l'utente corrispondente all'oggetto specificato userId se esiste.

Implementazioni

Si applica a