title: Cannot implicitly convert type 'System.Linq.IQueryable<>to . An explicit conversion exists (are you missing a cast?)
body: <p>I have the following code:</p>
  
  <pre><code>private GolfManagementEntities db = new GolfManagementEntities();
  
      public class ThanhToan
      {
          public ThanhToan()
          { }
          public Double Total { get; set; }
          public DateTime date { get; set; }
      }
  
      public List&lt;ThanhToan&gt; listInvoice(DateTime tuNgay, DateTime denNgay)
      {
  
         List&lt;ThanhToan&gt; invoice= from i in db.Invoices 
                                  where i.Date &gt;= tuNgay &amp;&amp; i.Date &lt;= denNgay 
                                  group i by i.Date into In 
                                  select new ThanhToan { 
                                      date= Convert.ToDateTime(In.Key) , 
                                      Total = Convert.ToDouble(In.Sum(s =&gt; s.ExtendedCost))
                                 };
  
         return invoice;
  
  }
  </code></pre>
  
  <p>And I got this error :</p>
  
  <p><strong>Cannot implicitly convert type 'System.Linq.IQueryable&lt;>to . An explicit conversion exists (are you missing a cast?)</strong></p>
  
  <p>please help me</p>