Esempio n. 1
0
        private async Task <T> AddCommentWithEmail <T>(int currentUserId, string commentText, Claim claim, DateTime now,
                                                       bool isVisibleToPlayer, Func <UserSubscription, bool> predicate, Comment parentComment,
                                                       CommentExtraAction?extraAction = null, IEnumerable <User> extraSubscriptions = null) where T : ClaimEmailModel, new()
        {
            var visibleToPlayerUpdated = isVisibleToPlayer && parentComment?.IsVisibleToPlayer != false;

            claim.AddCommentImpl(currentUserId, parentComment, commentText, now, visibleToPlayerUpdated, extraAction);

            var extraRecepients =
                new[] { parentComment?.Author, parentComment?.Finance?.PaymentType?.User }.
            Union(extraSubscriptions ?? Enumerable.Empty <User>());

            return
                (await
                 CreateClaimEmail <T>(claim, currentUserId, commentText, predicate, visibleToPlayerUpdated, extraAction, extraRecepients));
        }