public Comment(Post belongsTo, UserInfo author, string body) { Post = belongsTo; User = author; Body = body; CreationDate = DateTime.Now; }
private static Post NewPost() { Post post = new Post() .EnableComments() .Publish(); Posts.Add(post); return post; }
private void FixupPost(Post previousValue) { if (previousValue != null && previousValue.Comments.Contains(this)) { previousValue.Comments.Remove(this); } if (Post != null) { if (!Post.Comments.Contains(this)) { Post.Comments.Add(this); } } }