开发者

How to partially load entity framework POCO

开发者 https://www.devze.com 2023-01-06 17:54 出处:网络
I have an EF 4.0 model that has a parent child relationship (say order and orderdetails) order { [primative]

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

0

精彩评论

暂无评论...
验证码 换一张
取 消