public async Task <ViewCommentDto> AddComment(string userId, int topicId, CommentDto commentDto) { var topic = await _topicService.GetTopic(topicId); var comment = new Comment { Content = commentDto.Content, UserId = userId, TopicId = topicId }; await Do(async() => await _context.Comments.AddAsync(comment)); comment.User = await _userService.GetUserById(userId); if (userId != topic.UserId) { await _notificationService.NotifyComment(comment.User, topic, comment.Id); } var dto = ViewCommentDto.Create(userId, comment); _topicsHub.SendComment(topic.Id, dto); return(dto); }