UserStoreBase<TUser,TKey,TUserClaim,TUserLogin,TUserToken>.SetUserNameAsync 方法

定义

为指定的 user设置给定userName的 。

public virtual System.Threading.Tasks.Task SetUserNameAsync (TUser user, string userName, System.Threading.CancellationToken cancellationToken = default);
public virtual System.Threading.Tasks.Task SetUserNameAsync (TUser user, string? userName, System.Threading.CancellationToken cancellationToken = default);
abstract member SetUserNameAsync : 'User * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.SetUserNameAsync : 'User * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overridable Function SetUserNameAsync (user As TUser, userName As String, Optional cancellationToken As CancellationToken = Nothing) As Task

参数

user
TUser

应设置其名称的用户。

userName
String

要设置的用户名。

cancellationToken
CancellationToken

CancellationToken,用于传播应取消操作的通知。

返回

表示异步操作的 Task

实现

适用于