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 作業的 。

適用於