C
C#8mo ago
nedved

How to deserialize JSON like a normal person

How does one deserialize big nested json without making ton of wrapper classes or whatever. Or where do I put these classes to not make a mess in my project?
3 Replies
Jimmacle
Jimmacle8mo ago
what kind of wrapper classes? writing models that match the shape of the json is the recommended practice
Pobiega
Pobiega8mo ago
and you only need to write models for the parts you care about. if an object has 40 props but you only care about one of them, you only model that one prop
Yawnder
Yawnder8mo ago
You basically got two choices: Make the classes for the things you want deserialized, or load it into JTokens and suffer.
Want results from more Discord servers?
Add your server