コード例 #1
0
        public IActionResult UpdateBooking(BookingViewModel booking)
        {
            bool IsBookingUpdated;

            if (!ModelState.IsValid)
            {
                return(BadRequest("Invalid data."));
            }
            else
            {
                IsBookingUpdated = bookingRequest.UpdateBooking(booking);
            }
            if (IsBookingUpdated)
            {
                return(Ok());
            }
            else
            {
                return(BadRequest("Booking  is not UPdated"));
            }
        }
コード例 #2
0
 public IActionResult OnPost()
 {
     _services.UpdateBooking(Booking);
     return(RedirectToPage("Index"));
 }