public async Task <IActionResult> Create([FromBody] RecipeDTO recipeDto) { var recipe = Recipe.Create(recipeDto.Name, recipeDto.Description, recipeDto.Servings, recipeDto.Calories, recipeDto.CookingTime, 0, 0, 0, 0); await _recipesRepository.Add(recipe); foreach (var ingredient in recipeDto.Ingredients) { await _ingredientsRepository.AddIngredient(recipe.Id, ingredient.Name, ingredient.Quantity, ingredient.UnitOfMeasurement); } foreach (var instruction in recipeDto.InstructionSteps) { await _instructionsRepository.AddInstruction(recipe.Id, instruction.Description, instruction.InstructionNr); } return(Ok(recipe)); }