共用方式為


UserManager<TUser>.AddClaimAsync(TUser, Claim) 方法

定義

將指定的 claim 加入至 user

public:
 virtual System::Threading::Tasks::Task<Microsoft::AspNetCore::Identity::IdentityResult ^> ^ AddClaimAsync(TUser user, System::Security::Claims::Claim ^ claim);
public virtual System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.IdentityResult> AddClaimAsync (TUser user, System.Security.Claims.Claim claim);
abstract member AddClaimAsync : 'User * System.Security.Claims.Claim -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.IdentityResult>
override this.AddClaimAsync : 'User * System.Security.Claims.Claim -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.IdentityResult>
Public Overridable Function AddClaimAsync (user As TUser, claim As Claim) As Task(Of IdentityResult)

參數

user
TUser

要加入宣告的使用者。

claim
Claim

要加入的宣告。

傳回

Task 表示非同步作業,包含 IdentityResult 作業的 。

適用於