Although the loop in the MVC view is not necessarily bad, some purists (as you think) prefer to keep their views super clean and devoid of any processing logic.
Fortunately for you, the gem is little known in MVC that it can take a list of IEnumerable objects and map it to an editor / display template attached to a single object - it handles the loop for you.
For example, if you set up a partial representation of the display template, call it BarModel.cshtml (you should save it in one of the search paths PartialViewLocationFormats , under the "DispalyTemplate" subfolder):
@model MyApp.BarModel <li>@Model.SomeValue: @Model.SomeOtherValue</li>
Now, in your opinion, you can simply call the display template using Html.DisplayFor and pass the complete list as a model:
<div> Bars: <ul> @Html.DisplayFor(m => m.Bars) </ul> </div>
What is it. It will take your BarModels list and generate a partial display screen for each BarModel object in the list.
Of course, with your simple example, this is really for personal preference, since there is no significant advantage, unless you just want to get rid of the logic of the loop.
But if you ever need to share this display pattern in multiple places on the same view or in different views, it really pays off to build your views like this and reduce code complexity and duplication.
One more note: this approach assumes that you want to display each item in the list and in the order in which it is stored in the list. If you need to conditionally display elements or display them in a different order, this approach will not work.
However, if that is the case, I would suggest tweaking the list exactly as you need it to appear in the view. That is, do any filtering / sorting in the controller / service that creates the list, and leave your view simply by rendering your models.