diff --git a/HardwareShop/HardwareShopDatabaseImplement/Models/Storekeeper/Component.cs b/HardwareShop/HardwareShopDatabaseImplement/Models/Storekeeper/Component.cs index a445046..b856592 100644 --- a/HardwareShop/HardwareShopDatabaseImplement/Models/Storekeeper/Component.cs +++ b/HardwareShop/HardwareShopDatabaseImplement/Models/Storekeeper/Component.cs @@ -44,7 +44,7 @@ namespace HardwareShopDatabaseImplement.Models.Storekeeper } } - public static Component? Create(HardwareShopDatabase context, ComponentBindingModel model) + public static Component? Create(ComponentBindingModel model) { if (model == null) { @@ -55,12 +55,7 @@ namespace HardwareShopDatabaseImplement.Models.Storekeeper Id = model.Id, ComponentName = model.ComponentName, Cost = model.Cost, - UserId = model.UserId, - Builds = model.ComponentsBuilds.Select(x => new ComponentBuild - { - Build = context.Builds.First(y => y.Id == x.Key), - Count = x.Value.Item2 - }).ToList() + UserId = model.UserId }; }