Json.NET or cjson
anyone know which is better (setup, usage, flexibility, performance) obviously in your personal opinion/experience and applied work with these?
JSon.NET or cjson ??
I have not used either and was about to create my own pa开发者_如何学Crser which I realize is a whole different ballgame.
I'm personally a fan of Json.NET for the reason that it handles date serialization correctly using DateTimeOffset
instances. From my experience, neither the DataContractJsonSerializer
class nor the JavaScriptSerializer
class handle this situation correctly; they both assume it is not a scalar type and make a mess of those instances by trying to export all the properties of the object (when in reality it should be serialized as a call to new Date...
).
I also like that you an work with JSON data dynamically using Json.NET. That's a massive boon if you aren't working with statically typed data.
Think of using serializer provided by Microsoft in .Net System.Web.Script.Serialization.JavaScriptSerializer : http://blogs.msdn.com/b/rakkimk/archive/2009/01/30/asp-net-json-serialization-and-deserialization.aspx
精彩评论