Skip to content Skip to sidebar Skip to footer

Use JavaScriptSerializer To Deserialize Object When JSON Is Wrapped

Sample of JSON: { '1':{ 'guid':'8a40135230891fa70130891ff1000009', 'portalId':23832 } } The code that I am using to deserialize is: var serializer = new Java

Solution 1:

Try giving deserializing it do a Dictionary<string, HubspotRecord> or a Dictionary<string, WebHookResponse>. I can't say I've used the JavaScriptSerializer much, but I'd expect it to create an entry in the database with a key of "1" and the appropriate value. Worth a try, anyway :)

Alternatively, you might want to load it in Json.NET into a DOM-like structure, and just deserialize the bit you really want.


Post a Comment for "Use JavaScriptSerializer To Deserialize Object When JSON Is Wrapped"