create dictionary from json [duplicate]

21 hours ago 3
ARTICLE AD BOX

I have some json that looks like this:

"lines": { "0010": { "ProvCountyCode": "047", "ProvNo": "770887", "ParNonparCode": "K", "ParNonparCode2": "K", }, "0020" { "ProvCountyCode": "047", "ProvNo": "0888", "ParNonparCode": "K", "ParNonparCode2": "K", }, ...

Visual Studio (C#) Paste Special / Classes from JSON creates something like this:

public class Lines { public _0010 _0010 { get; set; } public _0020 _0020 { get; set; } } public class _0010 { public string ProvCountyCode { get; set; } public string ProvNo { get; set; } public string ParNonparCode { get; set; } public string ParNonparCode2 { get; set; } } public class _0020 { public string ProvCountyCode { get; set; } public string ProvNo { get; set; } public string ParNonparCode { get; set; } public string ParNonparCode2 { get; set; } } ...

this doesn't look very useful to me. further down there is a json array called lineSummary that includes a value LineID I am thinking i want to reference the dictionary like

Lines[LineId]

I can't change the json. I am looking to create a class that accomodates it

Read Entire Article