Custom Web Api Json Converter For A Single Property

Tuesday, September 23, 2014

The web is well documented regarding usage of a custom Json Converter. Basically the idea is to inherit from JsonConvert, explore the current serialized type and use your own custom behavior when serializing. The custom Json Convert can be used explicitly by calling Json.Convert or implicitly by registering in Application_Start. Explicit: Implicit: The implicit registration will serialize every object that contains the specified type (DateTime? in our example) using the MyJsonDateTimeConverter Converter. The explicit usage will only affect the current serialized value. The other case Both technics won't work in the following case; I need the converter to work only on a specified property, but I cannot...
tags: , , ,
no comments