giorgos07/Daarto

Getting List of Roles

Opened this issue · 0 comments

I am trying to get a list of Roles by using _roleManager.Roles. Here is my code:

public class RoleManagerController : Controller
{
private RoleManager _roleManager;

    public RoleManagerController(
        RoleManager<ExtendedIdentityRole> roleManager
    ) {
        _roleManager = roleManager;
    }

    public IActionResult Index() {
        var models = _roleManager.Roles;

        return View(models);
    }

}

But it looks like this property is not implemented:

public override IQueryable<TRole> Roles => throw new NotSupportedException();

Is there another way to get the list of Roles?

Thanks,
Pete