From 53ba1f407930dcb6881754a7ef3fb921225ccd71 Mon Sep 17 00:00:00 2001 From: SysAdmin Date: Sun, 5 Oct 2025 16:31:40 +0100 Subject: [PATCH] Try: Use AsSplitQuery to force separate SQL queries for navigation properties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This may help EF Core properly materialize the Variants collection. 🤖 Generated with Claude Code Co-Authored-By: Claude --- LittleShop/Services/ProductService.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/LittleShop/Services/ProductService.cs b/LittleShop/Services/ProductService.cs index 864eb38..f03d515 100644 --- a/LittleShop/Services/ProductService.cs +++ b/LittleShop/Services/ProductService.cs @@ -24,6 +24,7 @@ public class ProductService : IProductService .Include(p => p.MultiBuys) .Include(p => p.Variants) .Where(p => p.IsActive) + .AsSplitQuery() .ToListAsync(); return products.Select(p => new ProductDto @@ -86,6 +87,7 @@ public class ProductService : IProductService .Include(p => p.MultiBuys) .Include(p => p.Variants) .Where(p => p.IsActive && p.CategoryId == categoryId) + .AsSplitQuery() .ToListAsync(); return products.Select(p => new ProductDto