UserManagerExtensions.AddClaim<TUser, TKey> Method (UserManager<TUser, TKey>, TKey, Claim)
Adds a user claim.
Namespace: Microsoft.AspNet.Identity
Assembly: Microsoft.AspNet.Identity.Core (in Microsoft.AspNet.Identity.Core.dll)
Syntax
public static IdentityResult AddClaim<TUser, TKey>(
this UserManager<TUser, TKey> manager,
TKey userId,
Claim claim
)
where TUser : class, IUser<TKey>
where TKey : object, IEquatable<TKey>
public:
generic<typename TUser, typename TKey>
where TUser : ref class, IUser<TKey>
where TKey : Object, IEquatable<TKey>
[ExtensionAttribute]
static IdentityResult^ AddClaim(
UserManager<TUser, TKey>^ manager,
TKey userId,
Claim^ claim
)
static member AddClaim<'TUser, 'TKey when 'TUser : not struct and IUser<'TKey> when 'TKey : Object and IEquatable<'TKey>> :
manager:UserManager<'TUser, 'TKey> *
userId:'TKey *
claim:Claim -> IdentityResult
<ExtensionAttribute>
Public Shared Function AddClaim(Of TUser As { Class, IUser(Of TKey) }, TKey As { Object, IEquatable(Of TKey) }) (
manager As UserManager(Of TUser, TKey),
userId As TKey,
claim As Claim
) As IdentityResult
Parameters
manager
Type: Microsoft.AspNet.Identity.UserManager<TUser, TKey>The user manager.
userId
Type: TKeyThe user ID.
claim
Type: System.Security.Claims.ClaimThe claim.
Return Value
Type: Microsoft.AspNet.Identity.IdentityResult
The added user claim.
Type Parameters
- TUser
The type of the user.
- TKey
The type of the key.
See Also
UserManagerExtensions Class
Microsoft.AspNet.Identity Namespace
ASP.NET Identity
Return to top