Esempio n. 1
0
        public Task SaveCommentAsync(int blogPostId, InputComment comment)
        {
            var storedComment = new StoredComment()
            {
                Name         = comment.Name,
                EmailAddress = comment.EmailAddress,
                Body         = comment.Body,
                Timestamp    = this.time.UtcNow
            };

            return(this.repo.SaveCommentAsync(blogPostId, storedComment));
        }
Esempio n. 2
0
        public Task SaveCommentAsync(int blogPostId, StoredComment comment)
        {
            this.dict.AddOrUpdate(blogPostId,
                                  addValue: new List <StoredComment>()
            {
                comment
            },
                                  updateValueFactory: (postId, commentsList) => {
                commentsList.Add(comment);
                return(commentsList);
            });

            return(Task.CompletedTask);
        }