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); } }
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); } }