public IActionResult Post(BookingModel bookingModel) { IActionResult result; if (bookingModel.HasErrors()) { result = BadRequest(new ErrorModel(bookingModel.Errors())); } else { var booking = BookingLogic.Create(bookingModel.ToEntity(), bookingModel.GetGuests()); result = Created("GetBooking", new BookingBasicInfoModel(booking)); } return result; }
public void ValidBookingModelIsValid() { Assert.IsFalse(BookingModel.HasErrors()); }