From d7096544102897fd81ff819386b5fd22f0382366 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Sun, 30 Nov 2025 16:59:28 +0100 Subject: [PATCH] fix error in GetTotalQuantityEndpoint.cs --- .../WareHouseProducts/GetTotalQuantityEndpoint.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PyroFetes/Endpoints/WareHouseProducts/GetTotalQuantityEndpoint.cs b/PyroFetes/Endpoints/WareHouseProducts/GetTotalQuantityEndpoint.cs index 6df7fd9..0101118 100644 --- a/PyroFetes/Endpoints/WareHouseProducts/GetTotalQuantityEndpoint.cs +++ b/PyroFetes/Endpoints/WareHouseProducts/GetTotalQuantityEndpoint.cs @@ -31,9 +31,10 @@ public class GetTotalQuantityEndpoint( return; } - int totalQuantity = - await warehouseProductsRepository.SumAsync(new GetProductTotalQuantitySpec(req.ProductId), - wp => wp.Quantity, ct); + int? totalQuantityNullable = await warehouseProductsRepository. + SumAsync(new GetProductTotalQuantitySpec(req.ProductId), wp => wp.Quantity, ct); + + int totalQuantity = totalQuantityNullable ?? 0; GetTotalQuantityDto responseDto = new() {