This is how you can use nested foreach
loops to achieve what you want:
@foreach (Problems problems in Model)
{
foreach (Category category in problems.Categories)
{
@Html.DisplayNameFor(category => @category.Title)
}
...
}
You may have to add a using
statements at the top of your view into include the namespaces that your models are in. ie:
@using MyApp.Models