public UserMessageViewModel(UserMessage message, bool sender)
 {
     Sent = message.Created.ToString("dd/MM/yy H:mm");
     Content = message.Content;
     Sender = sender;
     By = message.Sender.FirstName;
 }
Пример #2
0
        public UserMessage CreateUserMessage(string comment, int addresseeId)
        {
            var neighbour = _securityService.GetUser(addresseeId);

            var message = new UserMessage
            {
                Content = comment,
                Sender = _securityService.CurrentUser(),
                Addressee = neighbour
            };

            _unitOfWork.UserMessageRepository.Create(message);

            _unitOfWork.Save();

            return message;
        }