我有 4 个关系表;
- 类别
- 产品
- 产品品牌
- 产品图片
我需要linq查询包括3 个表分组ProductBrand from CategoryId。
我试试这个;
var PBrand = from b in db.ProductBrands
join p in db.Products on b.BrandId equals p.BrandId
join i in db.ProductImages on p.ProductId equals i.ProductId
where b.CategoryId == 5
select b;
但是Products并且ProductImages为空。我如何在桌子上包括Products和桌子?ProductImagesBrand