Deserializing custom JSON in C#

I am attempting to deserilize some custom JSON into a Dictionary, but I'm having a hard time figuring out how to approach it. I've done it before having a Model class, but in this case, I need to do it in a specific way.

Here's what the Json looks like:

 {
     Values:
        {
          "Value1":"XXX",
          "value2" :
                 {
                       "SubValue1":"YX",
                       "SubValue2":"AB"
                 }
       }
}

The goal here would be to create a Dictionary<string,string> and populate it, so that:

    Key          Value
    Value1       XXX
    Value2       {
                   "SubValue1":"YX",
                   "SubValue2":"AB"
                 }   

Is there a quick way to get this deserilized like that? Any tips or hints on how to get this done easily?



from Recent Questions - Stack Overflow https://ift.tt/3vJKv3M
https://ift.tt/eA8V8J

Comments

Popular posts from this blog

Spring Elasticsearch Operations

Object oriented programming concepts (OOPs)

Spring Webflux : How to return HTTP 200 response with body when the called service returns HTTP 201 without body with WebClient?