22 Replies
I know thath some times thath will be null but i dont want an exception to ocurres
What are you doing?
What are you deserializing?
response of server
Deserialize the response to a class
Do not use
dynamic
i prefere JsonNode :c
Do NOT use dynamic
why 😰
Because dynamic disables all type safety. This means you won't get any intellisense, any type hints, any compile-time safety, etc.
Tell me why
Ain't nothin' but a heartache
Dynamic is capital B Bad in 99.999% of cases
It should not be used unless there is a very very very good reason
This is not one of them
i dont know the whole response of the server :/
What server is it?
im scraping the api of my router
to make an watcher
of the cpu
and ram of my router on real time
of your router...?
and then make analitycs
yea 😃
modem
but i guess i will just ad and try catch
:C
Well, you should still be deserializing to a class for the information you do know
yes but
Paste your JSON into $jsongen
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.
but some times changes idk my router is kinda sus
These automatically generate classes from your JSON
that definitely seems sus
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.