I have a class with property type of Point ( struct in .NET Framework).
I use JsonConvert from Newton.Json to serialize it to JSON.
But result is
"Point" : "100,100"
Instead of
"Point" : { X: "100", Y: "100"}
When I replace JsonConvert with standard JavascriptSerializer,
all works fine.
But I want to use JsonConverter from JSON.Net, because it’s much faster.
That’s because
Pointhas defined its ownTypeConverterand JSON.NET uses it to do the serialization. I’m not sure whether there is a clean way to turn this behavior off, but you can certainly create your ownJsonConverterthat behaves the way you want:You can then use it like this: