示例#1
0
        public ActionResult Index(string postId)
        {
            PostDTOWithPaginatedComments   postDTOWithPaginatedComments   = postService.GetPostWithPaginatedComments(postId, pageSize: Settings.COMMENT_PAGE_SIZE);
            PostModelWithPaginatedComments postModelWithPaginatedComments = dataMapper.MapPostDTOToModelWithPaginatedComments(postDTOWithPaginatedComments);

            return(View(postModelWithPaginatedComments));
        }
示例#2
0
        public PostDTOWithPaginatedComments GetPostWithPaginatedComments(string id, int pageSize)
        {
            PostEntityWithPaginatedComments postEntityWithPaginatedComments = postRepository.GetPostWithPaginatedComments(id, pageSize);
            PostDTOWithPaginatedComments    postDTOWithPaginatedComments    = dataMapper.MapPostEntityToDTOWithPaginatedComments(postEntityWithPaginatedComments);

            return(postDTOWithPaginatedComments);
        }
示例#3
0
        public PostModelWithPaginatedComments MapPostDTOToModelWithPaginatedComments(PostDTOWithPaginatedComments postDTOWithPaginatedComments)
        {
            if (postDTOWithPaginatedComments == null)
            {
                return(null);
            }

            PostDTO postDTO = postDTOWithPaginatedComments.Post;
            PaginationDTO <CommentDTO> commentPaginationDTO = postDTOWithPaginatedComments.CommentPaginationDTO;

            PostModelWithPaginatedComments postModelWithPaginatedComments = new PostModelWithPaginatedComments()
            {
                Post = MapPostDTOToModel(postDTO),
                CommentPaginationModel = MapCommentPaginationDTOToModel(commentPaginationDTO)
            };

            return(postModelWithPaginatedComments);
        }