How deserialize JSON[edit | edit source]
in dotNet[edit | edit source]
- from System.Web.Helpers.dll by Json.Decode
- Windows.Data.Json for Win 8+
- Newtonsoft Json.NET and Json.Linq or Path
- simple Regex
inherited classes deserialization problem[edit | edit source]
DataContractJsonSerializer cannot deserialize complex objects, and __type is not managed.
XmlSerializer cannot help with complex objects too, only DataContractSerializer is needed.
marking properties[edit | edit source]
opt-in is turned on when class marked by DataContract
As of .NET 3.0, you can use DataContract instead of Serializable. With the DataContract though, you will need to either "opt-in" by marking the serializable fields with the DataMember attribute; or "opt-out" using the IgnoreDataMember... opt-out by default will only serialize public members, while opt-in will only serialize the marked members (regardless of protection level)
Wcf uses Typewriter
Newtonsoft.Json uses JsonProperty, JsonIgnore attributes.