public PostViewModel(MBlogModel.Post post) : this() { DateLastEdited = post.Edited; DatePosted = post.Posted; Id = post.Id; Title = post.Title; Post = post.BlogPost; Link = post.TitleLink; AddCommentViewModel = new AddCommentViewModel(post.Id, post.CommentsEnabled); foreach (MBlogModel.Comment comment in post.Comments) { if (comment.Approved) { var cvm = new CommentViewModel(comment); AddCommentViewModel.AddComment(cvm); } } }
public void AddComment(CommentViewModel commentViewModel) { Comments.Add(commentViewModel); }