I have an action that returns a model to the View which is IEnumerable. In the view I loop through the list using foreach. T type has a property called
IEnumerable
The problem was @model IEnumerable in the view. I changed that to List and use instead a for loop:
@model IEnumerable
@model List @for (int i = 0; i < Model.Count(); i++) { @Model[i].Title }
SAVE