Share via


UserManagerExtensions.Create<TUser> Method (UserManager<TUser>, TUser, String)

Create a user and associates it with the given password (if one is provided)

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

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function Create(Of TUser As {Class, IUser}) ( _
    manager As UserManager(Of TUser), _
    user As TUser, _
    password As String _
) As IdentityResult
'Usage
Dim manager As UserManager(Of TUser)
Dim user As TUser
Dim password As String 
Dim returnValue As IdentityResult 

returnValue = manager.Create(user, _
    password)
public static IdentityResult Create<TUser>(
    this UserManager<TUser> manager,
    TUser user,
    string password
)
where TUser : class, IUser
[ExtensionAttribute]
public:
generic<typename TUser>
where TUser : ref class, IUser 
static IdentityResult^ Create(
    UserManager<TUser>^ manager, 
    TUser user, 
    String^ password
)
static member Create : 
        manager:UserManager<'TUser> * 
        user:'TUser * 
        password:string -> IdentityResult   when 'TUser : not struct and IUser
JScript does not support generic types and methods.

Type Parameters

  • TUser

Parameters

  • user
    Type: TUser

Return Value

Type: Microsoft.AspNet.Identity.IdentityResult

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type UserManager<TUser>. 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.111) or https://msdn.microsoft.com/en-us/library/bb383977(v=vs.111).

See Also

Reference

UserManagerExtensions Class

Create Overload

Microsoft.AspNet.Identity Namespace