Esempio n. 1
0
 public void DishIngredientDelete(DishIngredient item)
 {
     try
     {
         DishIngredientList.Attach(item);
         DishIngredientList.Remove(item);
         this.SaveChanges();
     }
     catch (Exception e)
     {
         Console.WriteLine(e);
         throw;
     }
 }
Esempio n. 2
0
        public void DishIngredientChange(DishIngredient item)
        {
            try
            {
                var ser = DishIngredientList.Where(x => x.Id == item.Id).First();

                ser.Quantity      = item.Quantity;
                ser.IngredientsId = item.IngredientsId;
                ser.DishId        = item.DishId;
                this.SaveChanges();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }