且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将Json字符串转换为c#类对象?

更新时间:2022-11-19 09:19:24

发生此错误是因为您试图将一个集合反序列化为一个对象.另外,您正在使用通用Object.您将需要使用

The error occurs because you are trying to deserialize a collection to an object. Also you are using the generic Object. You will need to use

List<PersonDetail> personDetails = objJavascript.Deserialize<List<PersonDetail>>(jsn);