Ejemplo n.º 1
0
        // DELETE api/values/5
        public void Delete(int id)
        {
            Food food = foodDao.GetById(id);

            if (food != null)
            {
                foodDao.DeleteFood(id);
            }
        }
Ejemplo n.º 2
0
        public HttpResponseMessage Delete(int id)
        {
            FoodDAOMSSQL foodDao = new FoodDAOMSSQL();

            if (id == 0)
            {
                return(Request.CreateResponse(HttpStatusCode.NoContent));
            }
            else
            {
                foodDao.DeleteFood(id);
                return(Request.CreateResponse(HttpStatusCode.OK, id));
            }
        }