I create a page with a table that displays all users. I need in the column next to display the user roles. I try to do it as follows:
<td> @Html.DisplayFor(modelItem => Model.Roles.First(p => p.Value == item.Roles.ToArray()[0].RoleId)) </td> Gives an error message:
Patterns can only be used with field referrals, property accesses, a one-dimensional array index, and a custom indexer with a single parameter.