I am studying a MVC sample. I couldn't wrap my head around the syntax of "@Html.DisplayFor(modelItem => item.FirstName)". In the following code, I understand modelItem is what passed into the view which is an object of IEnumerable<Runner>
. I am not understanding what does "modelItem => item" mean. In order word, How do you translate this lambda back to normal c# syntax? Thanks
@model IEnumerable<Runner>
<div id="Finishers">
<h4>Finishers</h4>
<ul id="finihers_female">
@foreach (var item in Model) {
<li>
@Html.DisplayFor(modelItem => item.FirstName)
@Html.DisplayFor(modelItem => item.LastName)
@Html.DisplayFor(modelItem => item.Gender)
@Html.DisplayFor(modelItem => item.FinishedTime)
</li>}
</ul>