0

The JSON data is:

{\"data\": [
  [\"f45dc1c8-b5ef-29ad-c12bc9731ddc1b59\", \"10002800\"],
  [\"1bcf618d-87c3-3542-61abbee73e09a29e\", \"10040646\"],
  ["c523aa86-2040-2eeb-844c16d61cad94ec", "10009514, 32295968"],
  ["1bcf618d-87c3-3542-61abbee73e09a29e", "10040646"],
  ....
]}

How can I get

"f45dc1c8-b5ef-29ad-c12bc9731ddc1b59",
"1bcf618d-87c3-3542-61abbee73e09a29e",
"c523aa86-2040-2eeb-844c16d61cad94ec",
....

by C#?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
MaggY
  • 9
  • 1
  • 3
    It is customary for you to do some research and try it yourself, then ask a specific question about a problem. Please [see how to ask](https://stackoverflow.com/help/how-to-ask) – Crowcoder Jun 14 '20 at 11:24
  • just search how to covert json to dictionary in C# in your search engine – Vivek Nuna Jun 14 '20 at 11:31
  • 1
    Is that your actual JSON? I'm confused because some of the values have quotes preceded by blackslashes while others do not. As it stands, it is not valid JSON. – Brian Rogers Jun 14 '20 at 20:36
  • I'm not sure but I got it from partner API. I cannot parse data – MaggY Jun 21 '20 at 16:51

1 Answers1

1

You can use Json.NET.

Here is an example:

string json = @"{ ""key1"":""value1"",
                 ""key2"":""value2""}";

var values = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);

Also, see this Stack Overflow answer.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
user366312
  • 16,949
  • 65
  • 235
  • 452