title: The model is of type List, but this dictionary requires IEnumerable
body: <p>In my controller I have a simple LINQ query:</p>
  
  <pre><code>var results = .....ToList();
  </code></pre>
  
  <p>Then, I want to pass 'results' into a View that renders a grid.  It takes a model of:</p>
  
  <pre><code>@model IEnumerable&lt;XXXX.WebSite.Areas.BrokerDashboard.Models.AccountHBSearchItem&gt;
  </code></pre>
  
  <p>I didn't think this would be a problem, but I get:</p>
  
  <blockquote>
    <p>The model item passed into the dictionary is of type 'System.Collections.Generic.List, but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable</p>
  </blockquote>
  
  <p>This confuses me, because from all that I'm reading, a <code>List&lt;T&gt;</code> already is an <code>IEnumerable&lt;T&gt;</code>.</p>
  
  <p>Based on an answer <a href="https://stackoverflow.com/questions/472669/freely-convert-between-listt-and-ienumerablet">here</a>, I tried this:</p>
  
  <pre><code>IEnumerable&lt;string&gt; eResults = results.ToList();
  </code></pre>
  
  <p>But that gets me the <code>Can implicitly convert</code> error.</p>
  
  <p>If I don't do the <code>.ToList()</code> then <code>results</code> is an IOrderedEnumerable, and I get this:</p>
  
  <blockquote>
    <p>The model item passed into the dictionary is of type 'System.Linq.OrderedEnumerable, but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable</p>
  </blockquote>
  
  <p><strong>EDIT:</strong></p>
  
  <p>This is the entire query:</p>
  
  <pre><code>            var results = Context.GetLeadSalesAccountTransactions(accountID)
              .OrderBy(a =&gt; a.TransactionDate)
             .Select(a =&gt;
             {
                 currentTotal -= a.Debit != null ? (decimal)a.Debit : 0;
                 currentTotal += a.Credit != null ? (decimal)a.Credit : 0;
                 return new AccountHBSearchItem
                 {
                     AccountTransactionID = a.AccountTransactionID,
                     LeadID = a.LeadSales != null ? a.LeadSales.Lead.LeadID : 0,
                     Address = a.LeadSales != null ? a.LeadSales.Lead.Address : string.Empty,
                     LotNumber = a.LeadSales != null ? a.LeadSales.Lead.LotNumber : string.Empty,
                     Type = a.AccountTransactionType.GetDisplayName(),
                     Debit = a.Debit,
                     Credit = a.Credit,
                     RemainingBalance = currentTotal,
                     TransDate = a.TransactionDate
                 };
             }
                    ).OrderByDescending(i =&gt; i.TransDate).ToList();
  </code></pre>