共用方式為


UserStore<TUser,TRole,TContext,TKey,TUserClaim,TUserRole,TUserLogin,TUserToken,TRoleClaim>.FindByNameAsync 方法

定義

尋找並傳回具有指定正規化使用者名稱的使用者。

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

參數

normalizedUserName
String

要搜尋的標準化使用者名稱。

cancellationToken
CancellationToken

用於散佈應取消作業通知的 CancellationToken

傳回

Task<TUser>

Task 表示非同步作業,其中包含符合指定 normalizedUserName 時的使用者。

實作

適用於