UserStore<TUser,TRole,TContext,TKey,TUserClaim,TUserRole,TUserLogin,TUserToken>.GetRolesAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Retrieves the roles the specified user
is a member of.
public virtual 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>>
Public Overridable Function GetRolesAsync (user As TUser, Optional cancellationToken As CancellationToken = Nothing) As Task(Of IList(Of String))
Parameters
- user
- TUser
The user whose roles should be retrieved.
- cancellationToken
- CancellationToken
The CancellationToken used to propagate notifications that the operation should be canceled.
Returns
A Task<TResult> that contains the roles the user is a member of.