0
我試圖得到一個可查詢使用EF Core獲取此加入查詢結果?
var result = _context.Product
.Include(a => a.ProductCategory)
.AsQueryable();
生產使用EF核心這個查詢的結果。
SELECT Prod.ProductId,
Prod.ProductName,
Prod.ProductCategoryId,
ISNULL(SUM(Inv.Quantity), 0) AS 'Qty'
FROM PRODUCTS Prod
LEFT JOIN InventoryProductDetails Inv ON Inv.ProductId = Prod.ProductId
WHERE Prod.Active = 'true'
GROUP BY Prod.ProductId,Prod.ProductName,Prod.ProductCategoryId
一旁的伎倆感謝 – wildwally