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

适用于