Уборка лишнего

This commit is contained in:
dasha 2023-04-02 17:42:07 +04:00
parent 1160862303
commit 4e6b34a77d

View File

@ -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) if (model == null)
{ {
@ -55,12 +55,7 @@ namespace HardwareShopDatabaseImplement.Models.Storekeeper
Id = model.Id, Id = model.Id,
ComponentName = model.ComponentName, ComponentName = model.ComponentName,
Cost = model.Cost, Cost = model.Cost,
UserId = model.UserId, UserId = model.UserId
Builds = model.ComponentsBuilds.Select(x => new ComponentBuild
{
Build = context.Builds.First(y => y.Id == x.Key),
Count = x.Value.Item2
}).ToList()
}; };
} }