private void SetupComments(Model.Post post) { List <Comment> comments = new List <Comment>(); foreach (var comment in post.Comments) { comments.Add(new Comment(comment)); } Comments = comments; }
public Post(Model.Post post) { Id = post.Id; Title = post.Title; Body = post.Body; CreatedOn = post.CreatedOn; User = new UserResponse.Profile(post.Owner); SetupComments(post); }