I have a JSON object that I'm struggling to convert to a C# class. Can anyone point me to the right direction ? How do you convert the marker section into a C# Class since the markers have a string followed by array. I've included the JSON return and also my class below. Any help or pointers ?
Thanks !
JSON:
{
"markers": {
"/New Quota (1)/two": {
"limit": 50,
"pending": 0,
"oq": 0,
"complete": 0
},
"/New Quota/AoAos/bo8Oi": {
"limit": 20,
"pending": 0,
"oq": 0,
"complete": 0
},
"/New Quota (1)/one": {
"limit": 50,
"pending": 0,
"oq": 0,
"complete": 0
}
},
"priority": {
"/New Quota (1)/one": 2
},
"plus": [
"four",
"five",
"three",
"two",
"one"
],
"sheets": {
"New Quota (1)": [
{
"cellCount": 1,
"tableTotal": 250,
"tableIndex": 0
"cells": [
{
"marker": "/New Quota (1)/one",
"components": [
"one"
]
},
{
"marker": "/New Quota (1)/two",
"components": [
"two"
]
}
]}]
},
"stopped": {
"/New Quota/AoAos/s9oVa": "erwin on 02/24/2015 12:48"
},
"defines": {
"XiiZn": {
"cond": "(q1.r6)",
"description": "55-64"
},
"LvmQy": {
"cond": "(q1.r2)",
"description": "18-24"
}
}
}
public class RootObject
{
public Sheet sheets { get; set; }
public Marker marker { get; set; }
}
public class Marker
{
public Dictionary<string,MarkerAttribute> markerAttribute { get; set; }
}
public class MarkerAttribute
{
public int limit { get; set; }
public int oq { get; set; }
public int pending { get; set; }
public int complete { get; set; }
}
public class Sheet
{
public SheetAttribute sheetAttribute { get; set; }
}
public class SheetAttribute
{
public int cellCount { get; set; }
public int tableTotal { get; set; }
public int tableIndex { get; set; }
public string description { get; set; }
public List<SheetCells> cells { get; set; }
}
public class SheetCells
{
public string marker { get; set; }
public List<string> component { get; set; }
}