C
C#2y ago
DeltaDizzy

✅ Determine the .NET type of a json object

I have a json generated by another program that i want to deserialize and manipulate the data of (using newtonsoft.json), but I am unsure what the .NET type I am deserializing it into should look like. The json file is attached.
8 Replies
Angius
Angius2y ago
$jsongen
MODiX
MODiX2y ago
Use https://app.quicktype.io or https://json2csharp.com to generate classes from your JSON
Instantly parse JSON in any language | quicktype
Whether you're using C#, Swift, TypeScript, Go, C++ or other languages, quicktype generates models and helper code for quickly and safely reading JSON in your apps. Customize online with advanced options, or download a command-line tool.
Convert JSON to C# Classes Online - Json2CSharp Toolkit
Convert any JSON object to C# classes online. Json2CSharp is a free toolkit that will help you generate C# classes on the fly.
Angius
Angius2y ago
(also, just use STJ, no need for Newtonsoft nowadays)
phaseshift
phaseshift2y ago
Also you can 'just paste' and theres an option in recent releases of studio to do that for you
DeltaDizzy
DeltaDizzyOP2y ago
huh neat ill admit i dont keep up with the community side of stuff a lot
Angius
Angius2y ago
Edit -> paste special -> json as classes Yeah, VS and Rider have it built-in Not really "community side"
DeltaDizzy
DeltaDizzyOP2y ago
well that includes the tools i guess
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server