Пример #1
0
        private MenuItemPrice GetDefaultPrice()
        {
            var result = Prices.SingleOrDefault(x => string.IsNullOrEmpty(x.PriceTag));

            if (result == null)
            {
                result = new MenuItemPrice();
                Prices.Add(result);
            }
            return(result);
        }
Пример #2
0
 public void UpdatePrices(IEnumerable <MenuItemPrice> prices)
 {
     foreach (var menuItemPrice in prices)
     {
         var mitemPrice = menuItemPrice;
         var price      = Prices.SingleOrDefault(x => x.PriceTag == mitemPrice.PriceTag);
         if (price == null)
         {
             price = new MenuItemPrice();
             Prices.Add(price);
         }
         price.Price    = mitemPrice.Price;
         price.PriceTag = mitemPrice.PriceTag;
     }
 }