title: Loop through list in model passed as a list
body: <p>This is the model I pass to my view as list:</p>
  
  <pre><code>    public class DogContentPage : ContentPage
      {
  
      public string Name { get; set; }
      public string Age { get; set; }
      public bool IsFemale { get; set; }
  
      public string Image { get; set; }
      public List&lt;string&gt; Merits { get; set; }
  }
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>@model List&lt;EmmysBlog_Core.Models.Dog.DogContentPage&gt;
  </code></pre>
  
  <p>As you can see the model contains a list of strings (Merits). I have troubles looping through the list of Merits. Im suspecting that the reasin for this is that i pass the model as a list..Is it possible for me to loop through merits?</p>
  
  <p>This attempt:</p>
  
  <pre><code>@foreach (var item in Model)
         {
            &lt;li&gt;@item.Merits&lt;/li&gt;
         }
  </code></pre>
  
  <p>Only gives me a list of:
  System.Collection.Generic...</p>
  
  <p>Do I have to change the way I pass the model to the view or is there another way of constructing the loop in order to access the values in Merits?</p>
  
  <p>View:</p>
  
  <pre><code>@foreach (var dogs in Model.Where(o =&gt; o.IsFemale))
                  {
                      &lt;div class="media"&gt;
                          &lt;div class="col-md-4"&gt;
                              &lt;a href="#"&gt;
                                  &lt;img src="@dogs.Image" style="width: 100%"&gt;
                              &lt;/a&gt;
  
                          &lt;/div&gt;
  
                          &lt;div class="col-md-4" style="text-align: center;"&gt;
                              &lt;a href="#"&gt;&lt;h3 class="media-heading"&gt;@dogs.Name&lt;/h3&gt;&lt;/a&gt;
                              @Html.ActionLink("Stamtavla", "Dog", "Home", new { pageId = dogs.Id }, null)
  
                          &lt;/div&gt;
                          &lt;div class="col-md-4"&gt;
                              &lt;ul&gt;
                                  @foreach (var item in Model)
                                  {
                                       foreach (var merit in item.Merits)
                                       {
                                           &lt;li&gt;@merit&lt;/li&gt;
                                       }
                                  }
  
                              &lt;/ul&gt;
  
                          &lt;/div&gt;
                      &lt;/div&gt;
                  }
                  &lt;/div&gt;
              &lt;/div&gt;
  </code></pre>