共用方式為


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

定義

為指定的 user 設定指定的 userName

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

參數

user
TUser

應該設定其名稱的使用者。

userName
String

要設定的使用者名稱。

傳回

表示非同步作業的 Task

適用於