title: Passing a List from Controller to View in MVC - Can't get string using foreach
body: <p>I'm trying to pass a List from my controller to a view.</p>
  
  <p>The model as defined in my view is:</p>
  
  <pre><code>@model List&lt;prismic.starter.Models.ResourceModel&gt;
  </code></pre>
  
  <p>I am passing a <code>List&lt;ResourceModel&gt;</code> from my controller to the view:</p>
  
  <pre><code> public async Task&lt;ActionResult&gt; resources()
      {
          var docArray = await new Prismic_Connect().getAllByType("resource");
          List&lt;ResourceModel&gt; resourceList = new List&lt;ResourceModel&gt;();
          foreach(var doc in docArray)
          {
              resourceList.Add(new ResourceModel(doc));
          }
          return View(resourceList);
      }
  </code></pre>
  
  <p>I can get the string value I am trying to display by writing the following:</p>
  
  <pre><code>@Model.First().getTitle();
  </code></pre>
  
  <p>However, when I try to loop through the list using <code>foreach</code> , the "title" string is not displayed.</p>
  
  <pre><code>@{ 
     foreach (var doc in Model)
     {
        doc.getTitle();
     }
   }
  </code></pre>
  
  <p>What am I doing wrong here?</p>