views:

300

answers:

0

I need a LINQ-to-Entities or Entity SQL based query to handle the following scenario:

Users belong to one or more Locations.

Shipments belong to exactly one Location.

Batches contain Shipments.

Users should only see Batches where ALL of the Shipments in the Batch are from Locations they have access to.

Example Batch:

Shipment_1.Location = 100
Shipment_2.Location = 200
Shipment_3.Location = 300

If the current user only has access to Location 200 then they should NOT see the above Batch.

If the current user had at least 100, 200, and 300 as Locations they would see the Batch.