Exemplo n.º 1
0
        public void InsertIngredientForRecipe(int idRecipe, int idIngredient, string quantity)
        {
            var ingredientforRecipeDAL = new IngredientsRecipe()
            {
                RecipeID           = idRecipe,
                IngredientID       = idIngredient,
                IngredientQuantity = quantity
            };

            ingredientsRecipeRepository.Create(ingredientforRecipeDAL);
        }
Exemplo n.º 2
0
        public void Update(IngredientsRecipeBL ingredient)
        {
            var id            = CheckIfIngredientExists(ingredient.Name);
            var ingredientDAL = new IngredientsRecipe()
            {
                IngredientID        = id,
                RecipeID            = ingredient.RecipeID,
                IngredientQuantity  = ingredient.Quantity,
                IngredientsRecipeID = ingredient.IngredientsRecipeID,
            };

            ingredientsRecipeRepository.Update(ingredientDAL);
        }