Пример #1
0
        public PostDTO MapEditedPostModelToDTO(APIEditedPostModel editedPostModel)
        {
            if (editedPostModel == null)
            {
                return(null);
            }

            PostDTO postDTO = new PostDTO()
            {
                Title             = editedPostModel.Title,
                PostCategory      = MapPostCategoryModelToDTO(editedPostModel.PostCategory),
                ThumbnailImageSrc = editedPostModel.ThumbnailImageSrc,
                ShortDescription  = editedPostModel.ShortDescription,
                Content           = editedPostModel.Content
            };

            return(postDTO);
        }
Пример #2
0
        public APIEditedPostModel MapEditedPostDTOToModel(PostDTO postDTO)
        {
            if (postDTO == null)
            {
                return(null);
            }

            APIEditedPostModel editedPostModel = new APIEditedPostModel()
            {
                Title             = postDTO.Title,
                PostCategory      = MapPostCategoryDTOToModel(postDTO.PostCategory),
                ThumbnailImageSrc = postDTO.ThumbnailImageSrc,
                ShortDescription  = postDTO.ShortDescription,
                Content           = postDTO.Content
            };

            return(editedPostModel);
        }