UserManagerExtensions.ChangePassword<TUser> Method
Change a user password
Namespace: Microsoft.AspNet.Identity
Assembly: Microsoft.AspNet.Identity.Core (in Microsoft.AspNet.Identity.Core.dll)
Syntax
'Declaration
<ExtensionAttribute> _
Public Shared Function ChangePassword(Of TUser As {Class, IUser}) ( _
manager As UserManager(Of TUser), _
userId As String, _
currentPassword As String, _
newPassword As String _
) As IdentityResult
'Usage
Dim manager As UserManager(Of TUser)
Dim userId As String
Dim currentPassword As String
Dim newPassword As String
Dim returnValue As IdentityResult
returnValue = manager.ChangePassword(userId, _
currentPassword, newPassword)
public static IdentityResult ChangePassword<TUser>(
this UserManager<TUser> manager,
string userId,
string currentPassword,
string newPassword
)
where TUser : class, IUser
[ExtensionAttribute]
public:
generic<typename TUser>
where TUser : ref class, IUser
static IdentityResult^ ChangePassword(
UserManager<TUser>^ manager,
String^ userId,
String^ currentPassword,
String^ newPassword
)
static member ChangePassword :
manager:UserManager<'TUser> *
userId:string *
currentPassword:string *
newPassword:string -> IdentityResult when 'TUser : not struct and IUser
JScript does not support generic types and methods.
Type Parameters
- TUser
Parameters
- manager
Type: Microsoft.AspNet.Identity.UserManager<TUser>
- userId
Type: System.String
- currentPassword
Type: System.String
- newPassword
Type: System.String
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).