Compare commits

..

No commits in common. "168dfb362737d11099e97395732a9f2424e737a5" and "21178474da69cbfc26521ce61e136a75de0e2032" have entirely different histories.

View File

@ -85,12 +85,20 @@ namespace FoodOrdersFileImplement.Implements
{ {
var dish = source.Dishs.FirstOrDefault(x => x.Id == model.Id); var dish = source.Dishs.FirstOrDefault(x => x.Id == model.Id);
int countStore = source.Shops if (dish == null)
.SelectMany(x => x.ShopDishs) {
.Where(y => y.Key == model.Id) return false;
.Sum(y => y.Value.Item2); }
if (dish == null || count > countStore)
var shopDishs = source.Shops.SelectMany(shop => shop.ShopDishs.Where(c => c.Value.Item1.Id == dish.Id));
int countStore = 0;
foreach (var it in shopDishs)
countStore += it.Value.Item2;
if (count > countStore)
return false; return false;
foreach (var shop in source.Shops) foreach (var shop in source.Shops)