In this recipe, we will take a look at how to iterate over a collection of data using
foreach. In this recipe, we will use NBuilder to create a list of
Product classes for us to work with. Then we will build three views that will iterate over the collection in different ways. We will show how to iterate over a collection of products pulled from
foreach. Then we will see how we can iterate over the
Model property of a strongly typed view. And finally, we will create another strongly typed view and use a
for statement to iterate over the collection.