« Interfaces and when what appears private is actually public. | Main | Second looks at dasBlog »

SimpleBlogService fixes.

Updating a posting via the SimpleBlogService was eliminating all categories and making the title link disappear.

The implementation of  Update in DataDTOProvider.cs expects the entry’s PostType property to be set and it wasn’t. This resulted in a CategoryType of StoryCollection being used where PostCollection would have been correct. The correct thing to do would be for Entries.GetEntry and Entries.GetCategoryEntry to correctly initialize the PostType property.

 

Since this wasn’t happening, I force the PostType to BlogPost in the Edit method of SimpleBlogService.

 

To correctly update the categories assigned to a post and prevent the assigned categories from being erased I added an overload for the Edit method that takes an array of category strings.

 

 

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)