共用方式為


UserStore<TUser,TRole,TContext,TKey,TUserClaim,TUserRole,TUserLogin,TUserToken,TRoleClaim>.GetRolesAsync 方法

定義

擷取指定 user 的角色是 的成員。

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

參數

user
TUser

應該擷取其角色的使用者。

cancellationToken
CancellationToken

用於散佈應取消作業通知的 CancellationToken

傳回

Task<TResult>,其中包含使用者所屬的角色。

實作

適用於