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 操作的 。

适用于