Пример #1
0
        internal static ComplaintDiscussionsViewModel MapDiscussions(Post[] posts)
        {
            var result = new ComplaintDiscussionsViewModel();

            result.Replies = Mappers.MapPosts(posts);

            return result;
        }
Пример #2
0
        private static List<DiscussionComment> MapPosts(Post[] posts)
        {
            var result = new List<DiscussionComment>();

            foreach (var post in posts)
                result.Add(Mappers.MapPost(post));

            return result;
        }
Пример #3
0
        private static DiscussionComment MapPost(Post post)
        {
            var result = new DiscussionComment();

            result.Id = post.Id;
            result.Text = post.Text;
            result.User = Mappers.MapUserToUserViewModel(post.User);

            if (post.Parent != null)
                result.RootComment = Mappers.MapParent(post.Parent);

            return result;
        }