Beispiel #1
0
 public SendMessageResponseDTO SendMessage(SendMessageRequestDTO request)
 {
     return(ServiceExecuterHelper <SendMessageRequestDTO, SendMessageResponseDTO> .Execute(
                _sendMessagePublisher.Publish,
                request,
                (ex) => { return ServiceException <SendMessageResponseDTO> .onException(ex); }));
 }
Beispiel #2
0
        public void SendMessage(long reservationId, Message message)
        {
            Reservation           reservation           = unitOfWork.Reservations.Get(reservationId);
            List <Message>        messages              = unitOfWork.Messages.Find(m => m.Reservation.Id == reservationId && m.Sender.Role != UserRole.AGENT).ToList();
            SendMessageRequestDTO sendMessageRequestDTO = new SendMessageRequestDTO(reservationId, messages.OrderByDescending(m => m.DatumVreme).First().Id, message);

            try
            {
                messagePortClient.respond(sendMessageRequestDTO.RespondRequest);
            }
            catch
            {
            }
            getMessagesByReservation(reservationId);
        }
        public Task <bool> SendMessage([FromBody] SendMessageRequestDTO req)
        {
            SendMessageCommand command = new SendMessageCommand(req);

            return(_bus.SendCommandAsync(command));
        }
 public SendMessageCommand(SendMessageRequestDTO dto)
 {
     sendMessageRequestDTO = dto;
 }