/// <summary>
        /// Updates entry in the database
        /// </summary>
        /// <param name="id">Identification number of the RecipeContent to be updated</param>
        /// <param name="ingredient">New RecipeContent details</param>
        /// <returns>Confirmation message</returns>
        public HttpResponseMessage Put(int id, [FromBody] RecipeContent content)
        {
            try
            {
                using (ContentsDBContext dbContext = new ContentsDBContext())
                {
                    var entity = dbContext.RecipeContents.FirstOrDefault(e => e.recipeId == id);

                    if (entity == null)
                    {
                        return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Recipe content with the ID " + id.ToString() + " not found"));
                    }
                    else
                    {
                        entity.recipeId     = content.recipeId;
                        entity.ingredientId = content.ingredientId;

                        dbContext.SaveChanges();

                        return(Request.CreateResponse(HttpStatusCode.OK, entity));
                    }
                }
            }
            catch (Exception e)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, e));
            }
        }
 /// <summary>
 /// Deletes an RecipeContent from the sql database
 /// </summary>
 /// <param name="id">ID of the RecipeContent to be deleted</param>
 /// <returns></returns>
 public HttpResponseMessage Delete(int id)
 {
     try
     {
         using (ContentsDBContext dbContext = new ContentsDBContext())
         {
             var entity = dbContext.RecipeContents.FirstOrDefault(e => e.recipeId == id);
             if (entity == null)
             {
                 return(Request.CreateErrorResponse(HttpStatusCode.NotFound,
                                                    "Recipe content with Id = " + id.ToString() + " not found to delete"));
             }
             else
             {
                 dbContext.RecipeContents.Remove(entity);
                 dbContext.SaveChanges();
                 return(Request.CreateResponse(HttpStatusCode.OK));
             }
         }
     }
     catch (Exception ex)
     {
         return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex));
     }
 }
        /// <summary>
        /// Creates a new RecipeContent entry in the database
        /// </summary>
        /// <param name="ingredient">RecipeContent to be added to the database</param>
        /// <returns>Confirmation message</returns>
        public HttpResponseMessage Post([FromBody] RecipeContent ingredient)
        {
            try
            {
                using (ContentsDBContext dBContext = new ContentsDBContext())
                {
                    dBContext.RecipeContents.Add(ingredient);
                    dBContext.SaveChanges();

                    var message = Request.CreateResponse(HttpStatusCode.Created, ingredient);
                    message.Headers.Location = new Uri(Request.RequestUri + ingredient.recipeId.ToString());

                    return(message);
                }
            }
            catch (Exception e)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, e));
            }
        }