исправление тупой ошибки

This commit is contained in:
dasha 2023-04-25 13:47:06 +04:00
parent 1149a8fe88
commit 26a38322ef

View File

@ -28,8 +28,18 @@ namespace SushiBarDatabaseImplement.Models
{
if (_shopSushi == null)
{
_shopSushi = ListSushiFk
.ToDictionary(recPC => recPC.SushiId, recPC => (recPC.Sushi as ISushiModel, recPC.Count));
_shopSushi = new();
ListSushiFk.ForEach(x =>
{
if (_shopSushi.ContainsKey(x.SushiId))
{
_shopSushi[x.SushiId] = (x.Sushi as ISushiModel, _shopSushi[x.SushiId].Item2 + x.Count);
}
else
{
_shopSushi[x.SushiId] = (x.Sushi as ISushiModel, x.Count);
}
});
}
return _shopSushi;
}