-1

DeserializeObject for { "15 Days": "675", "180 Days": "8100", "30 Days": "1350", "60 Days": "2700", "90 Days": "4050" }

1 Answers1

0

We can convert this json to dictionary. and this way around to handle this case. As we can directly deserialize to class object.

var test = "{ \"15 Days\": \"675\", \"180 Days\": \"8100\", 
\"30 Days\": \"1350\", \"60 Days\": \"2700\", \"90 Days\": 
\"4050\" }";
        string [] json = test.Replace("{", 
string.Empty).Replace("}", string.Empty).Split(',');
        Dictionary<string, string> jsonDic = new Dictionary<string, string>();
        for (int i = 0; i < json.Length; i++)
        {
            string[] jsonItem = json[i].Split(':');
            jsonDic.Add(jsonItem[1], jsonItem[0]);
        }

this dictionary jsonDic will look like below.

enter image description here

Hope this is helpful for you.

m.k.sharma
  • 155
  • 1
  • 2
  • 12