So I am using EF, I have the following entities:
WebsiteSectorProductAttributeAttributeTag
The relationships are as follow:

I need to retrieve something that is not directly linked to the table. Such as products which needs a Sector object in order to retrieve only the specific Products using something such as sector.Products.
But what if I need to retrieve all Products under a given Website instead of it’s parent Sector ?
In my specific situation, my questions are:
1) How can I retrieve all the products given a specific website_id – (Disregarding the sector)
2) How can I retrieve all the products that have a specific tag_id + website_id. (Also retrieve it’s corresponding Attribute)
Help is appreciated. Thanks!
Assuming you’ve got both side navigation properties :
you will have a
List<Sector> SectorListin Product Entity.you will have a
List<Product> ProductListin Sector Entity.(
sectors_productswon’t be present as an entity, as it’s not needed in an object world).you will have a
Website Websitein Sector Entityyou will have a
List<AttributeTag> AttributeTagListin Product Entity;(
products_tagswon’t be present as an entity, as it’s not needed in an object world).1) something like :
2) something like (taking 1) as base query)
or all in one