Question

Is there any easy way to load and pass/set the KnownTypes for the serializer? Meaning that without 1). adding [KnownType] attribute to the types 2). Or passing Type[]. Any help would be greatly appreciated.

Was it helpful?

Solution

After searching and checking for the other available .NET JSON serializer/de-serializer, i liked the way fastJSON & ServiceStack helped. Like DataContractResolver in DataContractSerializer(), fastJSON preserves the TYPE and ServiceStack is nice and clean at serialization time.

So for BOTH the libraries we no need to set [KnownType] attribute to the classes/types Or passing Type[] to the conversion method.

Here is a link about fastJSON in CodeProject: http://www.codeproject.com/Articles/159450/fastJSON

For ServiceStack : http://www.servicestack.net/

And also I have checked some other articles about the .NET JSON serializer's benchmark. Here I have listed only 2 of them:

1). http://theburningmonk.com/2012/11/json-serializers-benchmark-updated-including-mongodb-driver/ 2). http://www.servicestack.net/benchmarks/

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