Link to home
Start Free TrialLog in
Avatar of meetsys
meetsysFlag for United Kingdom of Great Britain and Northern Ireland

asked on

JSON.NET Deserialisation not able to retrieve some data

Hi all,

I have some Json which is successfully serialised using the following...
MyObj.Root deserializedMe= JsonConvert.DeserializeObject<MyObj.Root>(json);

Open in new window


It works very well until I get to the place where there is a further level without any title/name for the fields. Soemthing like the following.

MYGROUP":{"123":"HELPDESK"}

Open in new window


So MYGROUP can have as many items as possible. So I need some sort of list object with two variables. I keep getting a big JSON error and wondered if any someone could point me in the right direction.

So I have this...
 
public class MyObj
    {    
public class Root
        {
            public List<MYGROUP> MyGroups{ get; set; }
public class MYGROUP
        {
            string groupId { get; set; }
            public string name { get; set; }

        }}}

Open in new window


Its a toughy, so close to finally resolving all of this. Thanks in advance for any advice.
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial