我有以下代码:
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<> 隐式转换为 。存在显式转换(您是否缺少演员表?)
请帮我