public IHttpActionResult PostBooking(Booking booking) { DALServiceGateway<Booking> gate = new DALServiceGateway<Booking>(); if (!ModelState.IsValid) { return BadRequest(ModelState); } gate.PostItems("api/Booking/", booking); return CreatedAtRoute("DefaultApi", new { id = booking.Id }, booking); }
public IHttpActionResult PostHomePic(HomePic homePic) { DALServiceGateway<HomePic> gate = new DALServiceGateway<HomePic>(); if (!ModelState.IsValid) { return BadRequest(ModelState); } gate.PostItems("api/HomePics/",homePic); return CreatedAtRoute("DefaultApi", new { id = homePic.Id }, homePic); }
public IHttpActionResult PostMenu(Menu menu) { DALServiceGateway<Menu> gate = new DALServiceGateway<Menu>(); if (!ModelState.IsValid) { return BadRequest(ModelState); } gate.PostItems("api/Menu/", menu); return CreatedAtRoute("DefaultApi", new { id = menu.Id }, menu); }
public IHttpActionResult PostFood(Food food) { DALServiceGateway<Food> gate = new DALServiceGateway<Food>(); if (!ModelState.IsValid) { return BadRequest(ModelState); } gate.PostItems("api/Food/", food); return CreatedAtRoute("DefaultApi", new { id = food.Id }, food); }