public CommentFormDisplay(User user, Comment comment, PostDisplay post) { Post = post; User = user; Body = comment.Body; UserSubscribed = comment.UserSubscribed; }
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); }