79314876

Date: 2024-12-29 02:33:50
Score: 1.5
Natty:
Report link

Welp, thanks to How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET? - this did give me a thought to try - Since each object is (literally) a key with a collection of key-value pairs, the following line successfully turns the JSON into a useable object -

var temp = JsonConvert.DeserializeObject<Dictionary<string, Dictionary<string, string>>>(sensorsJson);

This likely wouldn't work if the schema of the JSON was altered in any way, but in the above case, it certainly worked.

Reasons:
  • Blacklisted phrase (0.5): thanks
  • Blacklisted phrase (0.5): How can I
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Coyttl