I'm new to Razorpages and wanted to include the roles of the users in IdentityUser (which I have overriden with ApplicationUser for a custom groupname). Therefore exists a table UserRoles, but I'm not able to connect UserRoles to IdentityUser.
This would act as a tiny usermanager to set a group (e.g. department) and assign roles.
Here is what I'm trying to accomplish:
<table class="table">
<thead>
<tr>
<th>
@Html.DisplayNameFor(model => model.ApplicationUser[0].UserName)
</th>
<th>
@Html.DisplayNameFor(model => model.ApplicationUser[0].Group)
</th>
<th>
@Html.DisplayNameFor(model => model.ApplicationUser[0].Role)
</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.ApplicationUser)
{
<tr>
<td>
@Html.DisplayFor(modelItem => item.UserName)
</td>
<td>
@Html.DisplayFor(modelItem => item.Group.Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.Role.Name)
</td>
<td>
<a asp-page="./Edit" asp-route-id="@item.Id">Edit</a> |
<a asp-page="./Details" asp-route-id="@item.Id">Details</a> |
<a asp-page="./Delete" asp-route-id="@item.Id">Delete</a>
</td>
</tr>
}
</tbody>
Any help is appreciated - thanks a lot!