Question

My CMS prefers to use the native .NET (WCF) date formatting, and I refuse to use that. So in my custom IService I set:

JsConfig.DateHandler = DateHandler.ISO8601;"

However, doing so seems to have forced their services to ALSO return in that format and it's borking some of their client templates.

Is my scenario doable, or do I have to suffer through the WCF date garbage?

Was it helpful?

Solution

The JsConfig settings you are seeing are global. You will run into the same problem if you try to set the serializer for DateTimes as a whole. Without a lot of work this is not easily doable.

Depending on how many services you have, you may be able to specify the serializing for them manually. This will have to be done manually for each service however. In the apphost simply define a JsConfig<ResponseType>.DeSerializeFn for each response type that you want to want to handle the custom serializing for and handle the DateTime appropriately.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top