UserManager<TUser>.AddPasswordAsync(TUser, String) 方法

定义

password仅当用户还没有密码时,才将 添加到指定的 user

public:
 virtual System::Threading::Tasks::Task<Microsoft::AspNetCore::Identity::IdentityResult ^> ^ AddPasswordAsync(TUser user, System::String ^ password);
public virtual System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.IdentityResult> AddPasswordAsync (TUser user, string password);
abstract member AddPasswordAsync : 'User * string -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.IdentityResult>
override this.AddPasswordAsync : 'User * string -> System.Threading.Tasks.Task<Microsoft.AspNetCore.Identity.IdentityResult>
Public Overridable Function AddPasswordAsync (user As TUser, password As String) As Task(Of IdentityResult)

参数

user
TUser

应设置其密码的用户。

password
String

要设置的密码。

返回

表示 Task 异步操作的 ,包含 IdentityResult 操作的 。

适用于