Rendering a list of objects into HTML
in Razor Pages I found two options.
Are these the same?
Using model property directly
<tbody>
@foreach (var item in Model.ResumeList)
{
<tr>
<td>@item.DeviceID</td>
</tr>
}
</tbody>
vs using Html.DisplayFor
<tbody>
@foreach (var item in Model.ResumeList)
{
<tr>
<td>@Html.DisplayFor(modelItem => item.DeviceID)</td>
</tr>
}
</tbody>
If not, what is the functional advantage of one over the other?