【发布时间】:2013-04-30 03:32:14
【问题描述】:
我在 mvc4 应用程序中有一个 linq 查询,它给了我错误
'无法创建'CMMIS.Domain.tblCustomer'类型的常量值。 仅支持原始类型或枚举类型 上下文。'
。任何帮助都是可观的。提前致谢。以下是我的代码-
public List<tblEquipment> getEquipmentByLaneAndContractId(string Lane, string contractId)
{
var query = (from c in _equipmentRepository.Table
from p in _customerRepository.Table
from q in _contractRepository.Table
where c.EquipLane == Lane && c.EquipActive == true && c.EquipCustID == p.CustID
&& p.CustContractID == q.ContractID && q.ContractID == contractId
select c).ToList();
return query;
}
【问题讨论】:
-
_equipmentRepository.Table的类型是什么?看this
标签: asp.net-mvc c#-4.0 asp.net-mvc-4 linq-to-entities entity-framework-4.1