共用方式為


UserManager<TUser>.GetUserAsync(ClaimsPrincipal) 方法

定義

傳回對應至主體或 Null 中 IdentityOptions.ClaimsIdentity.UserIdClaimType 宣告的使用者。

public:
 virtual System::Threading::Tasks::Task<TUser> ^ GetUserAsync(System::Security::Claims::ClaimsPrincipal ^ principal);
public virtual System.Threading.Tasks.Task<TUser> GetUserAsync (System.Security.Claims.ClaimsPrincipal principal);
public virtual System.Threading.Tasks.Task<TUser?> GetUserAsync (System.Security.Claims.ClaimsPrincipal principal);
abstract member GetUserAsync : System.Security.Claims.ClaimsPrincipal -> System.Threading.Tasks.Task<'User (requires 'User : null)>
override this.GetUserAsync : System.Security.Claims.ClaimsPrincipal -> System.Threading.Tasks.Task<'User (requires 'User : null)>
Public Overridable Function GetUserAsync (principal As ClaimsPrincipal) As Task(Of TUser)

參數

principal
ClaimsPrincipal

包含使用者識別碼宣告的主體。

傳回

Task<TUser>

對應至主體或 Null 中 IdentityOptions.ClaimsIdentity.UserIdClaimType 宣告的使用者

適用於