Esempio n. 1
0
        public void SendMessage(MessageDto message)
        {
            var newMessage = _addMessage.Add(_currentUserProvider.CurrentUser.Name, message.RoomId, message.Body);

            _unitOfWork.SaveChanges();

            var dto = new MessageInRoomDto
            {
                Username = newMessage.CreatedBy,
                DateCreated = newMessage.DateCreated,
                Body = newMessage.Body,
                RoomId = newMessage.RoomId
            };
            Clients.All.displayMessage(dto);
        }
Esempio n. 2
0
        public void SendMessage(MessageDto message)
        {
            var newMessage = _addMessage.Add(_currentUserProvider.CurrentUser.Name, message.RoomId, message.Body);

            _unitOfWork.SaveChanges();

            var dto = new MessageInRoomDto
            {
                Username    = newMessage.CreatedBy,
                DateCreated = newMessage.DateCreated,
                Body        = newMessage.Body,
                RoomId      = newMessage.RoomId
            };

            Clients.All.displayMessage(dto);
        }