Last week we ran into a situation where needed to serialize an generic IDictionary so that we could stuff it in a database. And of course you can’t do this using the .NET XML serializers because they only work with concrete types. But I knew from past experience with Web Services that this could be achieved using the JSON serializer that’s built into ASP.NET. Unlike Greg we only needed something “quick and dirty” so we just went and hooked up to the JSON serializer and in 5 minutes we had a working solution.
3 thoughts on “JSON Serialization is not just for Web Services”
Comments are closed.
JSON beats down XML once again! Great advice on serializing non-concrete types. If you ever need a simple JSON based service you have to check out Jayrock. I found this the other day and it saved me a bunch of time. http://jayrock.berlios.de/
One advantage to using XML is that SQL Server has native support for querying the data.