public async Task <int> AddThatFoods(string[] stringFoodIdList, int thatId) { MealFoods newMealFood = null; int success = 0; foreach (var thatFood in stringFoodIdList) { newMealFood = new MealFoods(); newMealFood.FKFoodId = Convert.ToInt32(thatFood); newMealFood.FKThatDayId = thatId; await _mealFoodsRepository.Add(newMealFood); success = await _mealFoodsRepository.Save(); } if (success > 0) { return(1); } return(0); }
public async Task <MealFoods> MealFoodsById(int Id) { MealFoods getMealFoods = await _mealFoodsRepo.Get(p => p.Id == Id); return(getMealFoods); }
public async Task <int> EditMealFoodsAsync(MealFoods mealFoods) { return(await _mealFoodsRepo.Edit(mealFoods)); }
public async Task <int> DeleteMealFoodsAsync(MealFoods mealFoods) { return(await _mealFoodsRepo.Delete(mealFoods)); }
public async Task <int> AddMealFoodsAsync(MealFoods mealFoods) { return(await _mealFoodsRepo.Add(mealFoods)); }