我的 Linq to Entity 查询有问题。我试图返回这样的列表:
List<InvoiceReportItem> cancelResults = (List<InvoiceReportItem>)(from cr in model.InvoiceReportItems
//join l in model.tblLicences on cr.LicenceAuto equals l.LicenceAuto
where cr.Report.Id == id
select cr);
但它给了我错误:
无法投射类型 >'System.Data.Objects.ObjectQuery
1[LicExpiryNotModel_EF41.Model.InvoiceReportItem]' to > type 'System.Collections.Generic.List
1[LicExpiryNotModel_EF41.Model.InvoiceReportItem]' 的对象。
有谁知道为什么会出现这个错误?快把我逼疯了!:(
提前感谢尼尔