UserManager<TUser, TKey>.AddClaimAsync Method

Adds a user claim.

Namespace:  Microsoft.AspNet.Identity
Assembly:  Microsoft.AspNet.Identity.Core (in Microsoft.AspNet.Identity.Core.dll)

Syntax

'Declaration
Public Overridable Function AddClaimAsync ( _
    userId As TKey, _
    claim As Claim _
) As Task(Of IdentityResult)
'Usage
Dim instance As UserManager 
Dim userId As TKey
Dim claim As Claim 
Dim returnValue As Task(Of IdentityResult)

returnValue = instance.AddClaimAsync(userId, _
    claim)
public virtual Task<IdentityResult> AddClaimAsync(
    TKey userId,
    Claim claim
)
public:
virtual Task<IdentityResult^>^ AddClaimAsync(
    TKey userId, 
    Claim^ claim
)
abstract AddClaimAsync : 
        userId:'TKey * 
        claim:Claim -> Task<IdentityResult> 
override AddClaimAsync : 
        userId:'TKey * 
        claim:Claim -> Task<IdentityResult> 
public function AddClaimAsync(
    userId : TKey, 
    claim : Claim
) : Task<IdentityResult>

Parameters

  • userId
    Type: TKey
    The user ID.
  • claim
    Type: Claim
    A property of a subject.

Return Value

Type: System.Threading.Tasks.Task<IdentityResult>
The task representing the asynchronous operation.

See Also

Reference

UserManager<TUser, TKey> Class

Microsoft.AspNet.Identity Namespace

Other Resources

ASP.NET Identity