public async Task <IHttpActionResult> AddCommentToGift(AddCommentToGiftDto model) { var userId = long.Parse(User.Identity.GetUserId()); var insertedComment = await _commentRepository.AddCommentToGift(model.GiftId, userId, model.Text, model.ParentCommentId); await _notificationService.SentNotificationToQueue(new AddCommentQueueNotification() { TargetType = "gift", TargetId = model.GiftId, CreatorId = userId, CommentId = insertedComment.Id }); if (model.ParentCommentId != null) { //Если это ответ к комменту то шлём ещё и юзеру владельцу коммента await _notificationService.SentNotificationToQueue(new ReplyToCommentQueueNotification() { TargetType = "gift", TargetId = model.GiftId, CreatorId = userId, CommentId = insertedComment.Id, ParentCommentId = (long)model.ParentCommentId }); } return(SuccessApiResult(insertedComment)); }