在我的 MVC 3 项目中,我使用的是 MySQL 连接器。当我尝试调用该方法时,我得到了Specified method is not supported
错误。为什么 ?
public IList<Order> GetOrders()
{
return (from x in db.Order
where (x.Address.FirstOrDefault() != null)
orderby x.Created //it's a DateTime
descending select x).ToList();
}
编辑
我看有问题x.Address.FirstOrDefault() != null
编辑2
该代码也有效
return (from x in db.Order
from y in db.Address
where (y.OrderID == x.OrderID)
orderby x.Created descending
select x).ToList();