Ejemplo n.º 1
0
 public CommentFormDisplay(User user, Comment comment, PostDisplay post)
 {
     Post = post;
     User = user;
     Body = comment.Body;
     UserSubscribed = comment.UserSubscribed;
 }
Ejemplo n.º 2
0
 public CommentDisplay(Comment comment)
 {
     LocalPublishedDate = comment.Published.Value.ToString("MMMM dd, yyyy");
     PermalinkHash = comment.Published.Value.ToString("yyyyMMddhhmmssf");
     User = comment.User;
     Body = comment.Body;
     Post = comment.Post;
 }
        public void AddCommentToBlogPost(string body, bool userSubscribed, User user, Post post)
        {
            var comment = new Comment
            {
                Body = body,
                User = user,
                Post = post,
                UserSubscribed = userSubscribed
            };

            //TODO: Need to implement publishing/pending stuff
            comment.Published = DateTime.UtcNow;

            post.AddComment(comment);
            _repository.Save(post);
        }