2

I've the following JSON:

{
    seq:108,
    d: 
    {
        s:'0',
        p:0,
        st:'ftt',
        time:153
    },
    h:[
        [287720,'James J.',0],
        [54421,'Martin M.',0],
        [54028,'Sara S.',0]
      ],
    e:[
        [2,9,252223,'Raul B.',4,{d:85124}],
        [2,28,287748,'Luis Y.',2,{}],
        [1,32,287746,'Ramiro L.',2,{}],
        [1,41,287719,'Franco T.',2,{}],
        [1,51,12295,'Marcos G.',4,{d:287746}],
        [1,57,287715,'Michael O\'Neal C.',4,{d:48191}]
      ]
}

And I've following classes to deserialize this JSON:

public class SModel
{
    public string seq { get; set; }
    public DModel d { get; set; }
    public List<List<string>> h { get; set; }
    //public List<List<string>> e { get; set; }
}

public class DModel
{
    public string s { get; set; }
    public string p { get; set; }
    public string st { get; set; }
    public int time { get; set; }
}

I am getting problem deserializing "e" in JSON. It's List<List<T>> and each T has and object in it. I need some guidance to write my classes to deserialize this JSON.

3
  • Why don't use public List<List<object>> e {get;set;} instead? Commented Nov 19, 2014 at 7:52
  • 1
    It worked. It feels silly sometimes how I couldn't get there. Please post your answer so that I can mark it as answer and up-vote it :) Commented Nov 19, 2014 at 8:09
  • 1
    Sometimes it's really helpful if you read your own problem "each T has an object in it". Commented Nov 19, 2014 at 8:15

1 Answer 1

1

What you can do is change the public List<List<string>> e {get; set;} to object

For Example:

public List<List<object>> e { get; set; }
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.