UserManagerExtensions.ChangePassword<TUser, TKey> Method (UserManager<TUser, TKey>, TKey, String, String)

 

Changes a user password.

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

Syntax

public static IdentityResult ChangePassword<TUser, TKey>(
    this UserManager<TUser, TKey> manager,
    TKey userId,
    string currentPassword,
    string newPassword
)
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^ ChangePassword(
    UserManager<TUser, TKey>^ manager,
    TKey userId,
    String^ currentPassword,
    String^ newPassword
)
static member ChangePassword<'TUser, 'TKey when 'TUser : not struct and IUser<'TKey> when 'TKey : Object and IEquatable<'TKey>> : 
        manager:UserManager<'TUser, 'TKey> *
        userId:'TKey *
        currentPassword:string *
        newPassword:string -> IdentityResult
<ExtensionAttribute>
Public Shared Function ChangePassword(Of TUser As { Class, IUser(Of TKey) }, TKey As { Object, IEquatable(Of TKey) }) (
    manager As UserManager(Of TUser, TKey),
    userId As TKey,
    currentPassword As String,
    newPassword As String
) As IdentityResult

Parameters

  • userId
    Type: TKey

    The user ID.

  • currentPassword
    Type: System.String

    The current password to change.

Return Value

Type: Microsoft.AspNet.Identity.IdentityResult

The new user password.

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