1

I have an array with following data schema

"coordinates" : [
      [
        [
          482035.87650000025,
          3768510.0446000006,
          0
        ],
        [
          482035.86720000021,
          3768514.4123,
          0
        ],
        [
          482035.68240000028,
          3768514.4119000006,
          0
        ]
      ]
  ]

What is the correct mapping class structure for Deserialize this json string into object using Newtonsoft Json

3
  • 1
    Desalinize?.... Commented Apr 6, 2018 at 11:47
  • Sorry edited the title correct word is "Deserialize" Commented Apr 6, 2018 at 11:48
  • Check this out stackoverflow.com/questions/46516067/… Commented Apr 6, 2018 at 11:57

1 Answer 1

6

If you'd wrap that in { } to make it a valid JSON object, this should be the class:

public class RootObject
{
    public List<List<List<double>>> coordinates { get; set; }
}

string adjustedFragment = "{ " + json + " }";
RootObject r = JsonConvert.DeserializeObject<RootObject>(adjustedFragment);
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.