예제 #1
0
        public void calculateCalories(int mealid)
        {
            var meal = _mealRepository.GetMealWithServingsAliment(mealid);

            meal.MealCalories = _context.Servings.Where(x => x.MealId == mealid).Sum(x => x.Calories);

            _context.SaveChanges();
        }
예제 #2
0
 public bool Save()
 {
     return(_context.SaveChanges() > 0);
 }