Andre Silveira

Andre Silveira

  • 1.5k
  • 148
  • 13.6k

IQueryable for many to many relationship

Nov 21 2021 9:43 PM

Let's say I have a table "produtcs" wich has a many to many reationship with the table "category" so that a product can be in many categories and each category has many products.

Using  IQueryable, how do I check if a product with the name "beer" in both in category "beverages" and "sport"?

Like how do I continue this 

IQueryable<Product> myQuery= _context.Products.Where(x => x.Name== "beer").... and???;


Answers (1)