共用方式為


UserManager<TUser>.AddClaimsAsync 方法

定義

將指定的 claims 加入至 user

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

參數

user
TUser

要加入宣告的使用者。

claims
IEnumerable<Claim>

要加入的宣告。

傳回

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

適用於