UserStore<TUser,TRole,TContext,TKey,TUserClaim,TUserRole,TUserLogin,TUserToken>.GetUserIdAsync(TUser, CancellationToken) 方法

定义

获取指定的用户标识符 user

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

参数

user
TUser

应检索其标识符的用户。

cancellationToken
CancellationToken

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

返回

Task<String>

Task表示异步操作的,其中包含指定的的标识符 user

实现

适用于