예제 #1
0
        public async Task <ActionResult> Put([FromBody] BookingEnd booking)
        {
            try
            {
                await bookings.EndAsync(booking);

                return(NoContent());
            }
            catch (KeyNotFoundException e)
            {
                return(NotFound(new { error = e.Message }));
            }
            catch (InvalidOperationException e)
            {
                return(BadRequest(new { error = e.Message }));
            }
            catch (ArgumentException e)
            {
                return(BadRequest(new { error = e.Message }));
            }
        }