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