I am trying to write a query that will search for "orders" that contain a certain "product" and I'm having a little difficulty getting it to work. Basically, this is what I'm trying to do:
Dim orders = From o in db.Orders _
Where o.OrderProducts.Contains(Function(p) p.ProductID = 123) _
Select o
I've also tried with ...
Where o.OrderProducts.Where(Function(p) p.ProductID = 123)
but that doesn't work either. Where am I going wrong? Thanks!