Exemple #1
0
        public CategoryDTO MapPostCategoryModelToDTO(APIPostCategoryModel postCategoryModel)
        {
            if (postCategoryModel == null)
            {
                return(null);
            }

            CategoryDTO categoryDTO = new CategoryDTO()
            {
                CategoryId = postCategoryModel.CategoryId,
                Name       = postCategoryModel.Name,
                PostCount  = postCategoryModel.PostCount
            };

            return(categoryDTO);
        }
Exemple #2
0
        public APIPostCategoryModel MapPostCategoryDTOToModel(CategoryDTO categoryDTO)
        {
            if (categoryDTO == null)
            {
                return(null);
            }

            APIPostCategoryModel postCategoryModel = new APIPostCategoryModel()
            {
                CategoryId = categoryDTO.CategoryId,
                Name       = categoryDTO.Name,
                PostCount  = categoryDTO.PostCount
            };

            return(postCategoryModel);
        }