var json = @"{
                           'DisplayName': '新一代算法模型',
                           'CustomerType': 1,
                           'Report': {
                             'TotalCustomerCount': 1000,
                             'TotalTradeCount': 50
                           },
                           'CustomerIDHash': [1,2,3,4,5]
                         }";

            var dict = JsonConvert.DeserializeObject<Dictionary<object, object>>(json);
            //取值方式
            Console.WriteLine(dict["DisplayName"].ToString());
            var report = dict["Report"] as JObject;
            var totalCustomerCount = report["TotalCustomerCount"];

            Console.WriteLine($"totalCustomerCount={totalCustomerCount}");

            var arr = dict["CustomerIDHash"] as JArray;
            var list = arr.Select(m => m.Value<int>()).ToList();
            Console.WriteLine($"list={string.Join(",", list)}");
  

 

相关文章:

  • 2021-11-21
  • 2021-09-08
  • 2022-12-23
  • 2022-12-23
  • 2021-11-11
  • 2022-02-09
  • 2022-02-16
  • 2022-12-23
猜你喜欢
  • 2021-10-10
  • 2021-08-27
  • 2022-12-23
  • 2018-03-03
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案