C# Newtonsoft中JArray 转成泛型List

错误写法:

  var data = new JArray() {"hello","world" };
  var list = data.ToList<string>();

以上写法会提示错误如下:

正确写法:

var data = new JArray() {"hello","world" };
var list = data.ToObject<List<string>>();
posted @ 2023-02-15 15:50  清和时光  阅读(1116)  评论(0编辑  收藏  举报