예제 #1
0
        public async Task RemoveRecipeWithProduct(int productId)
        {
            IEnumerable <Models.Recipe> recipes = context.Recipes.Where(recipe => recipe.Products.Any(product => product.ProductId == productId));

            context.RemoveRange(recipes);

            await context.SaveChangesAsync();
        }
예제 #2
0
 private void DeleteAllIngredients(int recipeID)
 {
     _context.RemoveRange(this.GetIngredients(recipeID));
 }