public void RemoveProduct(int productID) { var product = RecipeProducts.Find(p => p.ProductId == productID); if (product != null) { NoRecipeProducts.Add(product.Product); RecipeProducts.Remove(product); } }
public void AddProduct(int productID) { var product = NoRecipeProducts.Find(p => p.ProductId == productID); if (product != null) { RecipeProducts.Add(new ProductRecipe { ProductId = productID, RecipeId = RecipeId, Value = 0, Product = product }); NoRecipeProducts.Remove(product); } }