public async Task <ActionResult <RecipeDTO> > PostRecipe([FromBody][Bind("RecipeName,RecipeDescription,CategoryID,Category,CategoryName,TimeToPrepare,Vegetarian")]
                                                                 RecipeDTO recipeDTO)
        {
            if (recipeDTO == null)
            {
                return(BadRequest(new { Message = "Geen gerechten input" }));
            }
            ;

            var recipe = mapper.Map <Recipe>(recipeDTO);

            if (recipe == null)
            {
                return(BadRequest(new { Message = "Onvoldoende data." }));
            }

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }
            try
            {
                //if (!String.IsNullOrWhiteSpace(recipe.Category.CategoryName))
                //{
                //    recipe.Category = new Category();
                //    //recipe.Category.CategoryID = 0; //database maakt identity aan
                //    recipe.Category.CategoryName = formCollection["Category.CategoryName"];
                //}

                await recipeRepo.AddRecipeWithCategory(recipe);

                return(CreatedAtAction("GetRecipe", new { id = recipe.Id }, mapper.Map <RecipeDTO>(recipe)));
            }
            catch (DbUpdateException)
            {
                if (recipeRepo.Exists(recipe, recipe.Id).Result)
                {
                    return(Conflict());
                }
                else
                {
                    return(RedirectToAction("HandleErrorCode", "Error", new
                    {
                        statusCode = 400,
                        errorMessage = $"Het bewaren van gerecht '{recipe.RecipeName}' is mislukt."
                    }));
                }
            }
        }