예제 #1
0
        public async Task <IHttpActionResult> UpdateAsync(ReservationContract reservation)
        {
            try
            {
                await reservationService.UpdateAsync(reservation.ToModel());

                return(Content(HttpStatusCode.Accepted, reservation.ReservationId));
            }
            catch (KeyNotFoundException)
            {
                return(NotFound());
            }
        }
예제 #2
0
        public async Task <IHttpActionResult> AddAsync(ReservationContract reservation)
        {
            await reservationService.AddAsync(reservation.ToModel());

            return(Created(new Uri(Request.RequestUri, reservation.ReservationId.ToString()), reservation.ReservationId));
        }