Exemplo n.º 1
0
        public int RemoveProductFromMeal(MealManager _mealManager)
        {
            var dayHolder        = GetDay();
            var mealHolder       = GetMealFromDay(dayHolder);
            var itemInMealHolder = GetItemFromMeal(mealHolder, _mealManager);

            return(_dayService.RemoveProductFromMeal(itemInMealHolder, mealHolder, dayHolder));

            //mealHolder.ProductsInMeal.Remove(itemInMealHolder);
            //_dayService.RecalculateMacrosInMeal(mealHolder);
            //_dayService.RecalculateMacrosInDay(dayHolder);

            //Console.WriteLine("Total Carbs: " + mealHolder.TotalCarbs);
            //Console.WriteLine("Total fat: " + mealHolder.TotalFat);
            //Console.WriteLine("Total kcal: " + mealHolder.TotalKcal);
            //Console.WriteLine("Total protein: " + mealHolder.TotalProtein);
        }