facebook-csharp-sdk / simple-json

JSON library for .NET 2.0+/SL4+/WP7/WindowsStore with optional support for dynamic and DataContract
MIT License
382 stars 143 forks source link

Deserialize dynamic format issue #82

Open dhutapratama opened 6 years ago

dhutapratama commented 6 years ago

Hello,

I was try to deserialize json data to dynamic format by wiki documentation but always fail. and then i have an idea to change the format back to JsonObject and working.

Your Wiki Reference Deserialize JSON String Using dynamic

dynamic json = SimpleJson.DeserializeObject(data); string firstName = json.first_name; DateTime startDate = json.startDate int voteCount = json.voteCount List results = json.results;

My right way Deserialize JSON String Using dynamic

dynamic json = SimpleJson.DeserializeObject(data); string firstName = json["first_name"]; DateTime startDate = json["startDate"]; int voteCount = json["voteCount"]; List results = json["results"];