JSON.NET Deserialisation not able to retrieve some data

Posted on 2014-03-29
Medium Priority
Last Modified: 2014-03-29
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.


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.
Question by:meetsys
1 Comment
LVL 71

Accepted Solution

Éric Moreau earned 1000 total points
ID: 39963782
the best trick I can give you is to serialize an instantiated and filled object with your classes and look at the generated string.

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
Six Sigma Control Plans

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question