title: MVC 5 - Partial view not showing data
body: <p>I have a company model as seen below. </p>
  
  <p>The company model has an <code>IQueryable</code> of EmailHistory (this is another model).</p>
  
  <pre><code>public int Id { get; set; }
  public string CompanyName { get; set; }
  public IQueryable&lt;IEmailHistory&gt; EmailHistory { get; set; }
  </code></pre>
  
  <p>In my company controller i get my company details and get all my email history records, so this is my controller.</p>
  
  <pre><code>//Go to the repository and the company record
  var companyRecord = TheRepository.GetCompany(transaction.CompanyId, User.Identity.GetUserId());
  
  //Get the emails for this company
  companyRecord.EmailHistory = TheRepository.GetEmailHistoryByCompany(User.Identity.GetUserId(),
              Id);
  </code></pre>
  
  <p>If i expand the results at this point in the controller i can see emails for the company.... so far everything is ok.</p>
  
  <p>My company page has a partial view for the email history.</p>
  
  <pre><code>@ Html.Partial("~/Views/EmailHistory/_EmailHistories.cshtml", Model.EmailHistory);
  </code></pre>
  
  <p>The partial looks like this:</p>
  
  <pre><code>@model List&lt;AutoSend.Model.IEmailHistory&gt;
  
  &lt;table class="table"&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th style="width:100px" class="text-left"&gt;To&lt;/th&gt;
              &lt;th style="width:60px" class="text-left"&gt;Sent Date&lt;/th&gt;
              &lt;th style="width:60px" class="text-left"&gt;OutCome&lt;/th&gt;
              &lt;th style="width:60px" class="text-left"&gt;Delivered Date&lt;/th&gt;
              &lt;th style="width:60px" class="text-left"&gt;Opened Date&lt;/th&gt;       
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          @foreach (var emailHistory in Model)
          {
              &lt;tr&gt;
              &lt;td class="text-left"&gt;@Html.Display(emailHistory.EmailAddress)&lt;/td&gt;
              &lt;td class="text-left"&gt;@Html.Display(emailHistory.SentDate.ToShortDateString())&lt;/td&gt;
              &lt;td class="text-left"&gt;@Html.Display(emailHistory.OutCome)&lt;/td&gt;
              &lt;td class="text-left"&gt;@Html.Display(emailHistory.EmailDeliveredDate.ToShortDateString())&lt;/td&gt;
              &lt;td class="text-left"&gt;@Html.Display(emailHistory.EmailOpened.ToShortDateString())            &lt;/td&gt;
              &lt;/tr&gt;
          }
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>If i step through this i can see that we loop through the email history (and can see the values) fine but..... The page never actually renders out the data (although the associated td's are rendered)</p>
  
  <p>I can see the table headers and rows but no records are being shown!?</p>