Posts

Showing posts from September, 2018

Newtonsoft Json BaseJsonConverter

Image
I've recently had a need for a custom JsonConverter to read and write data to CosmosDb in a way that utilizes a CosmosDb document's `id` property. (more on that in a later post) My first step was to investigate a custom Newtonsoft.Json JsonConverter . I thought that there might be a BaseJsonConverter implementation somewhere in the docs, but I was wrong . After digging through many different custom converters, I think I've discovered what the most trivial custom converter might look like. You can find the example here, and customize it further to fit your needs: https://gist.github.com/aaronhoffman/de40ac508de95101fa41859195728e39 Hope this helps, Aaron