Collection does not allow foreach

-2

I have a collection and inside I have another collection of images. I need to make a foreach chained to grab information from the first collection, and then the second foreach to get the images I have referring to the first looping.

Here is my code:

@foreach ( var item in Model )
{
    <div class="title-pagina-interna">
        <h2>@item.Titulo</h2>
    </div>

    <div class="container-carrossel">
        @foreach (Imagem teste in item.Thumb)

But the following error is returning me:

  

How can I resolve this?

    
asked by anonymous 17.04.2014 / 23:20

1 answer

2

The type of the Thumb property of your item is not a collection of images; it is an image only, so it can not be used in @foreach . As you said you have a collection of images relative to the item in the first loop, you need to use the property that returns that collection.

    
17.04.2014 / 23:28