Example #1
0
        //POST - api/VnFoods
        public HttpResponseMessage Post([FromBody] Food food)
        {
            InitFoodData.InsertNewFood(food);
            var response = Request.CreateResponse(HttpStatusCode.Created, food);

            return(response);
        }
Example #2
0
 //DELETE api/VnFoods/id
 public void Delete(int id)
 {
     InitFoodData.DeleteFood(id);
 }
Example #3
0
 //PUT api/VnFoods/id
 public void Put(int id, [FromBody] Food food)
 {
     InitFoodData.UpdateFood(id, food);
 }