UserManager<TUser>.GetRolesAsync(TUser) Method

Definition

Gets a list of role names the specified user belongs to.

public:
 virtual System::Threading::Tasks::Task<System::Collections::Generic::IList<System::String ^> ^> ^ GetRolesAsync(TUser user);
public virtual System.Threading.Tasks.Task<System.Collections.Generic.IList<string>> GetRolesAsync (TUser user);
abstract member GetRolesAsync : 'User -> System.Threading.Tasks.Task<System.Collections.Generic.IList<string>>
override this.GetRolesAsync : 'User -> System.Threading.Tasks.Task<System.Collections.Generic.IList<string>>
Public Overridable Function GetRolesAsync (user As TUser) As Task(Of IList(Of String))

Parameters

user
TUser

The user whose role names to retrieve.

Returns

Task<IList<String>>

The Task that represents the asynchronous operation, containing a list of role names.

Applies to