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); }
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); }