Closed DominiqueFonteyn closed 5 years ago
It’s part of a demo around putting unique IDs for table rows for view screens.
On Wed, Mar 6, 2019 at 6:48 AM DominiqueFonteyn notifications@github.com wrote:
Hi,
I have question about the syntax you used in some of the Index pages. For instance, Course - Index https://github.com/jbogard/ContosoUniversity/blob/master/src/ContosoUniversity/Features/Course/Index.cshtml
There is a foreach loop that creates a table row for each Course, but instead of using the item variable you use an indexer to access the properties of that Course.
@Html.Display(modelItem => modelItem.Courses[i].CourseID)
What is the reason for doing it like this?
Thanks for helping me out.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jbogard/ContosoUniversity/issues/36, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGYMpNgOVYpsd5ER6XevIKj66td5B3bks5vT9UpgaJpZM4bhBMc .
Hi,
I have question about the syntax you used in some of the Index pages. For instance, Course - Index
There is a
foreach
loop that creates a table row for each Course, but instead of using theitem
variable you use an indexer to access the properties of that Course.@Html.Display(modelItem => modelItem.Courses[i].CourseID)
What is the reason for doing it like this?
Thanks for helping me out.