public IActionResult GetRecipeFromIngredient(int ingredientId) { if (!_ingredientRepository.IngredientExists(ingredientId)) { return(NotFound()); } var recipe = _ingredientRepository.GetRecipeOfAIngredient(ingredientId); if (!ModelState.IsValid) { return(BadRequest()); } var recipeDto = new RecipeDto() { Id = recipe.Id, Name = recipe.Name, Description = recipe.Description, PublishDate = recipe.PublishDate }; return(Ok(recipeDto)); }