public IHttpActionResult PutRecipe(long id, RecipeDal.Recipe recipe)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != recipe.RecipeId)
            {
                return(BadRequest());
            }

            db.Entry(recipe).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!RecipeExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult PostRecipe(RecipeDal.Recipe recipe)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Recipes.Add(recipe);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = recipe.RecipeId }, recipe));
        }
        public IHttpActionResult DeleteRecipe(long id)
        {
            RecipeDal.Recipe recipe = db.Recipes.Find(id);
            if (recipe == null)
            {
                return(NotFound());
            }

            db.Recipes.Remove(recipe);
            db.SaveChanges();

            return(Ok(recipe));
        }