예제 #1
0
        // POST: api/Beds
        public IHttpActionResult PostRoom([FromBody] BedView bed)
        {
            var model  = _mapper.MapBedViewToBed(bed);
            var result = _service.AddBed(model);

            if (result)
            {
                return(Ok());
            }
            else
            {
                return(InternalServerError());
            }
        }
        public async Task <IActionResult> AddBed(int hotelId, BedViewModel model)
        {
            await bedService.AddBed(model);

            return(RedirectToAction(nameof(HotelsController.Hotel), "Hotels", new { id = hotelId }));
        }