This is a fragment of view code from MVC tutorial
@model ContosoUniversity.Models.Student
...
Html.DisplayNameFor(model => model.LastName)
...
@foreach (var item in Model.Enrollments)
...
My silly question is why the model defined in the 1st statement as @model is used in the the second statement and it cannot be used in the the foreach loop of the last statement? Instead, the Model is used which is not declared in the view.