I have 2 tables, Category and ProductToCategory.
Category has the name of all categories, and ProductToCategory has a list of all the categories assigned to a product. It is separated because 1 product can have multiple categories.
I am new to entity framework and am trying to get a list of categories that assigned to a specific product. I need to return the information from the Category table, but the ProductToCategory is where I search to get what is assigned.
I am trying to get all categories where the category ID is assigned to the specific product ID in the ProductTOCategory table.
In SQL I would type:
SELECT (Category Fields) FROM Category WHERE Category.Id
IN (SELECT ProductToCategory.CategoryId FROM ProductToCategory
WHERE ProductId = (THE PRODUCT ID))
Or something like that