示例#1
0
        private async Task NotifyAboutLikedComment(int commentId)
        {
            var comment = await commentsRepo.FindCommentByIdAsync(commentId).ConfigureAwait(false);

            if (comment != null)
            {
                var notification = new LikedYourCommentNotification
                {
                    Comment     = comment,
                    LikedUserId = UserId,
                };
                await notificationsRepo.AddNotificationAsync(comment.CourseId, notification, UserId).ConfigureAwait(false);
            }
        }
示例#2
0
        private async Task NotifyAboutLikedComment(int commentId)
        {
            var comment = commentsRepo.FindCommentById(commentId);

            if (comment != null)
            {
                var userId       = User.Identity.GetUserId();
                var notification = new LikedYourCommentNotification
                {
                    Comment     = comment,
                    LikedUserId = userId,
                };
                await notificationsRepo.AddNotification(comment.CourseId, notification, userId);
            }
        }