Linq relational table include

后端 未结 2 1706
感情败类
感情败类 2021-01-25 11:56

I have 4 relational table;

  1. Category
  2. Product
  3. ProductBrand
  4. ProductImage

I need linq query included 3 table

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-25 12:10

    Use Include

    from b in db.ProductBrands.Include("Products.ProductImages") 
    where b.CategoryId == 5
    select b;
    

    Or the extension method Include.

提交回复
热议问题