11,567 questions
@john zyd , Welcome to Microsoft Q&A, you could try to install nuget-package Newtonsoft.Json to copy your data to Dictionary.
Here is a code example you could refer to.
static void Main(string[] args)
{
var jsonstr = File.ReadAllText("1.json");
Dictionary<string, List<NetWork>> dic = new Dictionary<string, List<NetWork>>();
JObject stuff = JObject.Parse(jsonstr);
var result = stuff.SelectTokens("data.symbols");
foreach (JProperty item in result.Children())
{
Console.WriteLine(item.Name);
List<NetWork> works = new List<NetWork>();
foreach (var re in item.Value["networks"])
{
NetWork net = new NetWork();
net.network = re["network"].ToString();
net.minWithdrawalAmount = Convert.ToDouble(re["minWithdrawalAmount"]);
works.Add(net);
}
dic.Add(item.Name, works);
}
}
Please don't forget we need to define a class called NetWork:
public class NetWork
{
public double minWithdrawalAmount { get; set; }
public string network { get; set; }
}
Best Regards,
Jack
If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.