자주 사용되는 메소드들
자주 사용되는 메소드들
자주 사용되는 메소드들
자주 사용되는 메소드들
public void AddIngredient(Ingredient ingredient) { if (!_ingredientRepository.ExistsByName(ingredient.Name)) { _ingredientRepository.Add(ingredient); return; } var existingIngredient = _ingredientRepository.FindByName(ingredient.Name); ingredient.Id = existingIngredient.Id; ingredient.Stock += existingIngredient.Stock; _ingredientRepository.Update(existingIngredient.Id, ingredient); }