public List<T> GetCustomerTxList(int customerId)
{
var matchingPocos = new List<T>();
using (linq.AOMSEntities dataRepos = new linq.AOMSEntities())
{
IEnumerable txlist = from t in dataRepos.TransactionRecord
where t.CustomerReference.Value.Id == customerId
select t;
foreach (EntityObject entity in txlist)
{
matchingPocos.Add(entity.ConvertToPoco<T>());
}
}
return matchingPocos;
}
我得到以下异常:
data.repository.integration.test.linqrepositorytest.getcustomertxlist(数据存储库集成测试linqrepositorytest.getcustomertxlist):
System.NotsupportedException:指定的类型成员“customerreference”在linq to entities中不受支持。仅支持初始值设定项、实体成员和实体导航属性。