public void SaveReservationWithGuests(ReservationWithGuestsCommand command) { var reservation = mapper.Map <Reservation>(command.Reservation); var guests = mapper.Map <List <Guest> >(command.Guests); reservationRepository.SaveReservationWithGuests(reservation, guests); }
public IActionResult SaveReservationWithGuests([FromBody] ReservationWithGuestsCommand command) { try { reservationService.SaveReservationWithGuests(command); return(Ok()); } catch (Exception ex) { return(BadRequest()); } }