c# - Some clarity on LINQ/LAMBDA to retrieve data from an intersection table please? -


i have following entities:

order -< orderitem >- product 

i need write linq retrieve order contains order items product id = 100.

so started along line of:

var order = order.where(r=>r.orderitems.productid == 100) ??? 

help required linq hugely appreciated.

many thanks.

var result = orders.where(o => o.orderitems.any(oi => oi.productid == 100)); 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -