I'm using asp.net core and I get list of roles (Identity roles) like:
[HttpGet]
public async Task<IActionResult> GetAvailableUserRoles()
{
var roles = _roleManager.Roles.ToList();
return Ok(roles);
}
So I want to display this list on view
I have an idea that first approach is to call controller like:
<form asp-controller="security" asp-action="GetAvailableUserRoles" method="get">
</form>
Now, how can I do a dropdown with RoleId
and Name
?