UserManagerExtensions.CreateIdentity<TUser, TKey> Method
Creates a ClaimsIdentity representing the user.
Namespace: Microsoft.AspNet.Identity
Assembly: Microsoft.AspNet.Identity.Core (in Microsoft.AspNet.Identity.Core.dll)
Syntax
'Declaration
<ExtensionAttribute> _
Public Shared Function CreateIdentity(Of TUser As {Class, Object, IUser(Of TKey)}, TKey As {Object, IEquatable(Of TKey)}) ( _
manager As UserManager(Of TUser, TKey), _
user As TUser, _
authenticationType As String _
) As ClaimsIdentity
'Usage
Dim manager As UserManager(Of TUser, TKey)
Dim user As TUser
Dim authenticationType As String
Dim returnValue As ClaimsIdentity
returnValue = manager.CreateIdentity(user, _
authenticationType)
public static ClaimsIdentity CreateIdentity<TUser, TKey>(
this UserManager<TUser, TKey> manager,
TUser user,
string authenticationType
)
where TUser : class, Object, IUser<TKey>
where TKey : Object, IEquatable<TKey>
[ExtensionAttribute]
public:
generic<typename TUser, typename TKey>
where TUser : ref class, Object, IUser<TKey>
where TKey : Object, IEquatable<TKey>
static ClaimsIdentity^ CreateIdentity(
UserManager<TUser, TKey>^ manager,
TUser user,
String^ authenticationType
)
static member CreateIdentity :
manager:UserManager<'TUser, 'TKey> *
user:'TUser *
authenticationType:string -> ClaimsIdentity when 'TUser : not struct and Object and IUser<'TKey> when 'TKey : Object and IEquatable<'TKey>
JScript does not support generic types and methods.
Type Parameters
- TUser
The type of the user.
- TKey
The type of the key.
Parameters
- manager
Type: Microsoft.AspNet.Identity.UserManager<TUser, TKey>
The user manager.
- user
Type: TUser
The user.
- authenticationType
Type: System.String
The authentication type.
Return Value
Type: ClaimsIdentity
The created ClaimsIdentity.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type UserManager<TUser, TKey>. When you use instance method syntax to call this method, omit the first parameter. For more information, see https://msdn.microsoft.com/en-us/library/bb384936(v=vs.108) or https://msdn.microsoft.com/en-us/library/bb383977(v=vs.108).
See Also
Reference
Microsoft.AspNet.Identity Namespace