@model IEnumerable<User>
@{
    ViewData["Title"] = "Users";
}

<table class="table">
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.Id)
            </th>
            <th>
                name*
            </th>
            <th>
                number of associated accounts
            </th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model) {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Id)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.DisplayName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Accounts.Count)x
            </td>
            <td>
                <a asp-action="Details" asp-route-id="@item.Id">Details</a>
            </td>
        </tr>
        }
    </tbody>
</table>