Model fixes.

This commit is contained in:
Yuee Shiness 2023-05-17 18:36:32 +04:00
parent f64c7b284c
commit f7c05cc17d

View File

@ -93,7 +93,7 @@ namespace ComputerStoreDatabaseImplement.Models
context.SaveChanges(); 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; updateComponent.Count = model.PCComponents[updateComponent.ComponentID].Item2;
model.PCComponents.Remove(updateComponent.ComponentID); model.PCComponents.Remove(updateComponent.ComponentID);