コード例 #1
0
        //POST hotels
        public HttpResponseMessage Post([FromBody] Hotel hotel)
        {
            hotel.CreatedDate = DateTime.Today;
            hotel.UpdatedDate = DateTime.Today;
            HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, _hotelManager.AddHotel(hotel));

            return(response);
        }
コード例 #2
0
        public IHttpActionResult Post(HotelViewModel hvmodel)
        {
            var h = _hotelManager.AddHotel(hvmodel);

            if (h == null)
            {
                return(NotFound());
            }
            return(Ok(h));
        }
コード例 #3
0
 public String AddHotel([FromBody] Hotels model)
 {
     return(_hotelManager.AddHotel(model));
 }