From 91bcdad9db6203b7b8e19fee32b32fd038056969 Mon Sep 17 00:00:00 2001 From: SysAdmin Date: Sun, 5 Oct 2025 16:29:48 +0100 Subject: [PATCH] Fix: Remove AsNoTracking to enable navigation property fixup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AsNoTracking() prevents EF Core from properly wiring up navigation properties. Removing it allows Include() to populate Variants collection correctly. 🤖 Generated with Claude Code Co-Authored-By: Claude --- LittleShop/Services/ProductService.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/LittleShop/Services/ProductService.cs b/LittleShop/Services/ProductService.cs index 86e8cc0..864eb38 100644 --- a/LittleShop/Services/ProductService.cs +++ b/LittleShop/Services/ProductService.cs @@ -24,7 +24,6 @@ public class ProductService : IProductService .Include(p => p.MultiBuys) .Include(p => p.Variants) .Where(p => p.IsActive) - .AsNoTracking() .ToListAsync(); return products.Select(p => new ProductDto @@ -87,7 +86,6 @@ public class ProductService : IProductService .Include(p => p.MultiBuys) .Include(p => p.Variants) .Where(p => p.IsActive && p.CategoryId == categoryId) - .AsNoTracking() .ToListAsync(); return products.Select(p => new ProductDto