I want to show all users assigned to a specific role in the view:
@model IEnumerable<Microsoft.AspNet.Identity.EntityFramework.IdentityRole>
<table id="tbrole" style="width:100%; border:dotted 1px; background-color:gainsboro; padding-left:10px;">
@foreach (var role in Model)
{
<tr>
<td style="width:100%; border:dotted 1px;">
@role.Name<br />
<ul>
@foreach (var userInRole in role.Users)
{
<li>@usersInRole.UserId</li>
}
</ul>
@if (role.Name != "Admin")
{
@Html.ActionLink("Delete", "Delete", new { id = role.Id }, new { style = "float:right;", @class = "glyphicon glyphicon-trash" })
}
</td>
</tr>}
</table>
How to access the user module (email, username, address..etc) using UserId
property