Временный костыль
This commit is contained in:
parent
fe0b7dd9bc
commit
49c182a591
@ -106,12 +106,16 @@ namespace ConfectioneryDatabaseImplement.Models
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
var shop = context.Shops.First(x => x.Id == model.Id);
|
var shop = context.Shops.First(x => x.Id == model.Id);
|
||||||
shop.ShopPastries.AddRange(model.Pastries.Select(x => new ShopPastry
|
foreach (var pc in model.Pastries)
|
||||||
{
|
{
|
||||||
Pastry = context.Pastries.First(y => y.Id == x.Key),
|
context.PastryComponents.Add(new()
|
||||||
Count = x.Value.Item2,
|
{
|
||||||
}).Except(shopPastries ?? new()));
|
Pastry = context.Pastries.First(y => y.Id == pc.Key),
|
||||||
context.SaveChanges();
|
Count = pc.Value.Item2,
|
||||||
|
});
|
||||||
|
context.SaveChanges();
|
||||||
|
}
|
||||||
|
context.SaveChanges();
|
||||||
_cachedPastries = null;
|
_cachedPastries = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user