title: Iterating within a partial view using model only works when not using partialview
body: <p>I´m trying to get some posts from the database. It works fine when opening in the posts index page but not in the main index. As a partialview, I have created a <code>PostViewModel</code> for the <code>PostModel</code>.</p>
  
  <p>Here´s the code:</p>
  
  <p>In Index.cshtml (Post):</p>
  
  <pre><code>@model IEnumerable&lt;Project.Models.Post&gt;
  
  @foreach (var item in Model) { @item.Name }
  </code></pre>
  
  <p>In Index.cshtml (Main):</p>
  
  <pre><code>@model Project.Models.ViewModels.PostViewModel
  
  @Html.Partial("~/Views/Posts/Index.cshtml", Model)
  </code></pre>
  
  <p>When I run the project, it complains about a <em>System.NullReferenceException</em>
  in the <code>foreach</code> loop.</p>
  
  <p>How can I solve this problem?</p>