From f7c05cc17d46384014ffce05daa51be5f85a3a22 Mon Sep 17 00:00:00 2001 From: Yuee Shiness Date: Wed, 17 May 2023 18:36:32 +0400 Subject: [PATCH] Model fixes. --- ComputerStoreDatabaseImplement/Models/PC.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ComputerStoreDatabaseImplement/Models/PC.cs b/ComputerStoreDatabaseImplement/Models/PC.cs index 704c246..3714977 100644 --- a/ComputerStoreDatabaseImplement/Models/PC.cs +++ b/ComputerStoreDatabaseImplement/Models/PC.cs @@ -93,7 +93,7 @@ namespace ComputerStoreDatabaseImplement.Models context.SaveChanges(); } - foreach(var updateComponent in pcComponents) + foreach(var updateComponent in pcComponents.Where(x => model.PCComponents.ContainsKey(x.ComponentID) && x.RequestID == model.RequestID)) { updateComponent.Count = model.PCComponents[updateComponent.ComponentID].Item2; model.PCComponents.Remove(updateComponent.ComponentID);