Currently I'm writing a TicketSystem in ASP.NET and have trouble with the Admin Panel.
I want read out the user roles and I'm getting the following error message:
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: "'System.Threading.Tasks.Task<System.Collections.Generic.IList<string>>' does not contain a definition for 'ToList'"
Code to read the user role:
public List<String> getRols(dynamic user)
{
return _UserManager.GetRolesAsync(user).ToList();
}
Many Thanx for your Help