Jak deserializować "przedmioty" class część tego łańcuch JSON:Json.NET: deserializacji Zagnieżdżony Json
{
"Buddies": {
"count": 1,
"items": [
{
"id": "5099207ee4b0cfbb6a2bd4ec",
"firstName": "Foo",
"lastName": "Bar",
"image": {
"url": "",
"sizes": [
60,
120,
180,
240,
360
],
"name": "myphoto.png"
}
}
]
}
}
Oryginalny klasa że mam to:
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; }
}
}
Ale górna część json jest całkiem bezużyteczny dla mnie i chcę, aby użyć tej klasy zamiast:
public class Buddy
{
public string Id { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
Podoba mi się to podejście, ale czy nie byłoby to w ogóle zamienić w Konwerter niestandardowy? ogic? – keyr