Пример #1
0
        public IActionResult CreateMessage(string receiverId, string content, string threadId)
        {
            PrivateMessageViewModel message = new PrivateMessageViewModel();

            message.Id         = Guid.NewGuid().ToString();
            message.From       = _userService.GetCurrentUser(User.Identity.Name).Username;
            message.Created    = DateTime.Now;
            message.receiverId = receiverId;
            message.Content    = content;

            _messageService.CreatePrivateMessage(message);

            return(RedirectToAction("ShowPosts", "Post", new { threadId }));
        }