How to partially load entity framework POCO
I have an EF 4.0 model that has a parent child relationship (say order and orderdetails)
order { [primative] orderid, ordername, ordershipping
[navigation] orderdetails }
orderdetail { orderdetai开发者_如何学运维lid, orderpartid, orderquantity, orderpartname }
My question is how do i load orders with orderdetails where the quantity is greater than 1 in LINQ?
for example
var orders = (from o in context.Orders.Include("OrderDetails") where....
any ideas?
Okay simple answer actually...
http://msmvps.com/blogs/matthieu/archive/2009/10/07/ef-include-with-where-clause.aspx
精彩评论