C
Join ServerC#
help
What am I doing wrong with this deserialized data?
MMetalkon9/19/2022
When I run my program i'm only getting nulls and zero's when trying to access card prices from the json provided. Anyone have an idea on what I did wrong in my code?
Json Used
https://db.ygoprodeck.com/api/v7/cardinfo.php?name=Tornado%Dragon
(reposted my question with less clutter)
Json Used
https://db.ygoprodeck.com/api/v7/cardinfo.php?name=Tornado%Dragon
(reposted my question with less clutter)

TTheRanger9/19/2022
well cardmarket_price isnt on the root of the json, if you deserialized right, you access it like this
price.data[0].card_prices[0].cardmarket_price
TTheRanger9/19/2022
you can let a site like https://json2csharp.com/ generate classes out of the json for you
MMetalkon9/19/2022
That worked, had no clue it had to be typed down that way (or why [0] is needed).
TTheRanger9/19/2022
because data and card_prices are arrays
MMetalkon9/19/2022
i see i see thanks, now to see if i can find more information about this. 🙂