我有以下代码:
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;
}
而我得到这个错误:
无法隐式转换类型“System.Linq.IQueryable <>来。 一个显式转换存在(是否缺少强制转换?)
请帮我