如何反序列化此Json字符串上的“Items”类部分:
原文链接:https://www.f2er.com/json/288441.html{ "Buddies": { "count": 1,"items": [ { "id": "5099207ee4b0cfbb6a2bd4ec","firstName": "Foo","lastName": "Bar","image": { "url": "","sizes": [ 60,120,180,240,360 ],"name": "myphoto.png" } } ] } }
我拥有的原始课程是:
public class Buddy { public IEnumerable<Item> Items { get; set; } public class Item { public string Id { get; set; } public string FirstName { get; set; } public string LastName { get; set; } } }
但是json的上半部分对我来说是无用的,我想要使用这个类:
public class Buddy { public string Id { get; set; } public string FirstName { get; set; } public string LastName { get; set; } }